summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2003-12-29 11:24:14 +0000
committerRichard M. Stallman <rms@gnu.org>2003-12-29 11:24:14 +0000
commitdc2628c1136068e34a39f6ddb13415cfdef26528 (patch)
treeba1da697cfadb7285e631e55771cd2e139dcd076 /src/fileio.c
parent6c2ef893427b86cbbcadcb271bf9b45e68e4b72e (diff)
downloademacs-dc2628c1136068e34a39f6ddb13415cfdef26528.tar.gz
(choose_write_coding_system): Ignore auto_saving
if using the visited file for auto saves. (Fwrite_region): Don't update SAVE_MODIFF if auto-saving in visited file.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/fileio.c b/src/fileio.c
index e586407cecc..a2b207169cf 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4685,7 +4685,9 @@ choose_write_coding_system (start, end, filename,
{
Lisp_Object val;
- if (auto_saving)
+ if (auto_saving
+ && NILP (Fstring_equal (current_buffer->filename,
+ current_buffer->auto_save_file_name)))
{
/* We use emacs-mule for auto saving... */
setup_coding_system (Qemacs_mule, coding);
@@ -5221,7 +5223,14 @@ This does code conversion according to the value of
update_mode_lines++;
}
else if (quietly)
- return Qnil;
+ {
+ if (auto_saving
+ && ! NILP (Fstring_equal (current_buffer->filename,
+ current_buffer->auto_save_file_name)))
+ SAVE_MODIFF = MODIFF;
+
+ return Qnil;
+ }
if (!auto_saving)
message_with_string ((INTEGERP (append)
@@ -5776,11 +5785,14 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
minibuffer_auto_raise = 0;
auto_saving = 1;
- /* First, save all files which don't have handlers. If Emacs is
- crashing, the handlers may tweak what is causing Emacs to crash
- in the first place, and it would be a shame if Emacs failed to
- autosave perfectly ordinary files because it couldn't handle some
- ange-ftp'd file. */
+ /* On first pass, save all files that don't have handlers.
+ On second pass, save all files that do have handlers.
+
+ If Emacs is crashing, the handlers may tweak what is causing
+ Emacs to crash in the first place, and it would be a shame if
+ Emacs failed to autosave perfectly ordinary files because it
+ couldn't handle some ange-ftp'd file. */
+
for (do_handled_files = 0; do_handled_files < 2; do_handled_files++)
for (tail = Vbuffer_alist; GC_CONSP (tail); tail = XCDR (tail))
{