/* File name in which we write a list of all our auto save files. */
Lisp_Object Vauto_save_list_file_name;
+/* Whether or not files are auto-saved into themselves. */
+Lisp_Object Vauto_save_visited_file_name;
+
/* Function to call to read a file name. */
Lisp_Object Vread_file_name_function;
}
return
- Fwrite_region (Qnil, Qnil,
- current_buffer->auto_save_file_name,
- Qnil, Qlambda, Qnil, Qnil);
+ Fwrite_region (Qnil, Qnil, current_buffer->auto_save_file_name, Qnil,
+ NILP (Vauto_save_visited_file_name) ? Qlambda : Qt,
+ Qnil, Qnil);
}
static Lisp_Object
a non-nil value. */);
Vauto_save_list_file_name = Qnil;
+ DEFVAR_LISP ("auto-save-visited-file-name", &Vauto_save_visited_file_name,
+ doc: /* Non-nil says auto-save a buffer in the file it is visiting, when practical.
+Normally auto-save files are written under other names. */);
+ Vauto_save_visited_file_name = Qnil;
+
#ifdef HAVE_FSYNC
DEFVAR_BOOL ("write-region-inhibit-fsync", &write_region_inhibit_fsync,
doc: /* *Non-nil means don't call fsync in `write-region'.