aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong <[email protected]>2008-03-31 22:07:40 +0000
committerChong Yidong <[email protected]>2008-03-31 22:07:40 +0000
commit31e31a154119cbfd884b69b05c0e055ece4237bb (patch)
treee5c1cf3adebb88589990b295c40b2be1983d2699
parentcb9b4cc6225c15701a21732d6ee9c918ff6953f9 (diff)
(auto_save_error_occurred): New var.
(auto_save_error): Set it. (Fdo_auto_save): Don't overwrite the error message if an auto-save error occurred.
-rw-r--r--src/fileio.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 124e107ac7..511cca59fd 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -159,6 +159,9 @@ int auto_saving;
a new file with the same mode as the original */
int auto_save_mode_bits;
+/* Set by auto_save_1 if an error occurred during the last auto-save. */
+int auto_save_error_occurred;
+
/* The symbol bound to coding-system-for-read when
insert-file-contents is called for recovering a file. This is not
an actual coding system name, but just an indicator to tell
@@ -5757,6 +5760,8 @@ auto_save_error (error)
char *msgbuf;
USE_SAFE_ALLOCA;
+ auto_save_error_occurred = 1;
+
ring_bell ();
args[0] = build_string ("Auto-saving %s: %s");
@@ -5928,6 +5933,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
make_number (minibuffer_auto_raise));
minibuffer_auto_raise = 0;
auto_saving = 1;
+ auto_save_error_occurred = 0;
/* On first pass, save all files that don't have handlers.
On second pass, save all files that do have handlers.
@@ -6042,8 +6048,9 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
sit_for (make_number (1), 0, 0);
restore_message ();
}
- else
- /* If we displayed a message and then restored a state
+ else if (!auto_save_error_occurred)
+ /* Don't overwrite the error message if an error occurred.
+ If we displayed a message and then restored a state
with no message, leave a "done" message on the screen. */
message1 ("Auto-saving...done");
}