diff options
| author | Chong Yidong | 2008-03-31 22:07:40 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-03-31 22:07:40 +0000 |
| commit | 31e31a154119cbfd884b69b05c0e055ece4237bb (patch) | |
| tree | e5c1cf3adebb88589990b295c40b2be1983d2699 /src | |
| parent | cb9b4cc6225c15701a21732d6ee9c918ff6953f9 (diff) | |
| download | emacs-31e31a154119cbfd884b69b05c0e055ece4237bb.tar.gz emacs-31e31a154119cbfd884b69b05c0e055ece4237bb.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c index 124e107ac74..511cca59fdb 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -159,6 +159,9 @@ int auto_saving; | |||
| 159 | a new file with the same mode as the original */ | 159 | a new file with the same mode as the original */ |
| 160 | int auto_save_mode_bits; | 160 | int auto_save_mode_bits; |
| 161 | 161 | ||
| 162 | /* Set by auto_save_1 if an error occurred during the last auto-save. */ | ||
| 163 | int auto_save_error_occurred; | ||
| 164 | |||
| 162 | /* The symbol bound to coding-system-for-read when | 165 | /* The symbol bound to coding-system-for-read when |
| 163 | insert-file-contents is called for recovering a file. This is not | 166 | insert-file-contents is called for recovering a file. This is not |
| 164 | an actual coding system name, but just an indicator to tell | 167 | an actual coding system name, but just an indicator to tell |
| @@ -5757,6 +5760,8 @@ auto_save_error (error) | |||
| 5757 | char *msgbuf; | 5760 | char *msgbuf; |
| 5758 | USE_SAFE_ALLOCA; | 5761 | USE_SAFE_ALLOCA; |
| 5759 | 5762 | ||
| 5763 | auto_save_error_occurred = 1; | ||
| 5764 | |||
| 5760 | ring_bell (); | 5765 | ring_bell (); |
| 5761 | 5766 | ||
| 5762 | args[0] = build_string ("Auto-saving %s: %s"); | 5767 | args[0] = build_string ("Auto-saving %s: %s"); |
| @@ -5928,6 +5933,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) | |||
| 5928 | make_number (minibuffer_auto_raise)); | 5933 | make_number (minibuffer_auto_raise)); |
| 5929 | minibuffer_auto_raise = 0; | 5934 | minibuffer_auto_raise = 0; |
| 5930 | auto_saving = 1; | 5935 | auto_saving = 1; |
| 5936 | auto_save_error_occurred = 0; | ||
| 5931 | 5937 | ||
| 5932 | /* On first pass, save all files that don't have handlers. | 5938 | /* On first pass, save all files that don't have handlers. |
| 5933 | On second pass, save all files that do have handlers. | 5939 | 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. */) | |||
| 6042 | sit_for (make_number (1), 0, 0); | 6048 | sit_for (make_number (1), 0, 0); |
| 6043 | restore_message (); | 6049 | restore_message (); |
| 6044 | } | 6050 | } |
| 6045 | else | 6051 | else if (!auto_save_error_occurred) |
| 6046 | /* If we displayed a message and then restored a state | 6052 | /* Don't overwrite the error message if an error occurred. |
| 6053 | If we displayed a message and then restored a state | ||
| 6047 | with no message, leave a "done" message on the screen. */ | 6054 | with no message, leave a "done" message on the screen. */ |
| 6048 | message1 ("Auto-saving...done"); | 6055 | message1 ("Auto-saving...done"); |
| 6049 | } | 6056 | } |