reenabled in it. If auto-save mode is already enabled, auto-saves
continue to go in the same file name until @code{auto-save-mode} is
called again.
+
+Note that setting this variable to a non-@code{nil} value does not
+change the fact that auto-saving is different from saving the buffer;
+e.g., the hooks described in @ref{Saving Buffers} are @emph{not} run
+when a buffer is auto-saved.
@end defopt
@defun recent-auto-save-p
@end deffn
Saving a buffer runs several hooks. It also performs format
-conversion (@pxref{Format Conversion}).
+conversion (@pxref{Format Conversion}). Note that these hooks,
+described below, are only run by @code{save-buffer}, they are not run
+by other primitives and functions that write buffer text to files, and
+in particular auto-saving (@pxref{Auto-Saving}) doesn't run these
+hooks.
@defvar write-file-functions
The value of this variable is a list of functions to be called before
(define-obsolete-variable-alias 'write-file-hooks 'write-file-functions "22.1")
(defvar write-file-functions nil
- "List of functions to be called before writing out a buffer to a file.
+ "List of functions to be called before saving a buffer to a file.
+Only used by `save-buffer'.
If one of them returns non-nil, the file is considered already written
and the rest are not called.
These hooks are considered to pertain to the visited file.
'write-contents-functions "22.1")
(defvar write-contents-functions nil
"List of functions to be called before writing out a buffer to a file.
+Only used by `save-buffer'.
If one of them returns non-nil, the file is considered already written
and the rest are not called and neither are the functions in
`write-file-functions'.
"Normal hook run just before auto-saving.")
(defcustom before-save-hook nil
- "Normal hook that is run before a buffer is saved to its file."
+ "Normal hook that is run before a buffer is saved to its file.
+Only used by `save-buffer'."
:options '(copyright-update time-stamp)
:type 'hook
:group 'files)
(defcustom after-save-hook nil
- "Normal hook that is run after a buffer is saved to its file."
+ "Normal hook that is run after a buffer is saved to its file.
+Only used by `save-buffer'."
:options '(executable-make-buffer-file-executable-if-script-p)
:type 'hook
:group 'files)