diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/fileio.c b/src/fileio.c index be52d0f3d0e..8c8cba9e49c 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -5142,19 +5142,26 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, | |||
| 5142 | if (! ok) | 5142 | if (! ok) |
| 5143 | report_file_errno ("Write error", filename, save_errno); | 5143 | report_file_errno ("Write error", filename, save_errno); |
| 5144 | 5144 | ||
| 5145 | bool auto_saving_into_visited_file = | ||
| 5146 | auto_saving | ||
| 5147 | && ! NILP (Fstring_equal (BVAR (current_buffer, filename), | ||
| 5148 | BVAR (current_buffer, auto_save_file_name))); | ||
| 5145 | if (visiting) | 5149 | if (visiting) |
| 5146 | { | 5150 | { |
| 5147 | SAVE_MODIFF = MODIFF; | 5151 | SAVE_MODIFF = MODIFF; |
| 5148 | XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG); | 5152 | XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG); |
| 5149 | bset_filename (current_buffer, visit_file); | 5153 | bset_filename (current_buffer, visit_file); |
| 5150 | update_mode_lines = 14; | 5154 | update_mode_lines = 14; |
| 5155 | if (auto_saving_into_visited_file) | ||
| 5156 | unlock_file (lockname); | ||
| 5151 | } | 5157 | } |
| 5152 | else if (quietly) | 5158 | else if (quietly) |
| 5153 | { | 5159 | { |
| 5154 | if (auto_saving | 5160 | if (auto_saving_into_visited_file) |
| 5155 | && ! NILP (Fstring_equal (BVAR (current_buffer, filename), | 5161 | { |
| 5156 | BVAR (current_buffer, auto_save_file_name)))) | 5162 | SAVE_MODIFF = MODIFF; |
| 5157 | SAVE_MODIFF = MODIFF; | 5163 | unlock_file (lockname); |
| 5164 | } | ||
| 5158 | 5165 | ||
| 5159 | return Qnil; | 5166 | return Qnil; |
| 5160 | } | 5167 | } |