summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2017-01-20 10:57:14 +0200
committerEli Zaretskii <eliz@gnu.org>2017-01-20 10:57:14 +0200
commit954e9e983b7e446ebf4a7b4dfee0dca82b6b57f7 (patch)
tree3bb5cc751c903e2778d354ec15c17b3f10ed2983 /lisp/files.el
parent9fcab85efd10090786266610f4dbb83ee0da4b31 (diff)
downloademacs-954e9e983b7e446ebf4a7b4dfee0dca82b6b57f7.tar.gz
Improve documentation of hooks related to saving buffers
* lisp/files.el (write-file-functions, write-contents-functions) (before-save-hook, after-save-hook): Note that these are only used by save-buffer. * doc/lispref/backups.texi (Auto-Saving): * doc/lispref/files.texi (Saving Buffers): Mention that save-related hooks are not run by auto-saving. (Bug#25460)
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el
index a6fe381a50a..83ef4e271cd 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -440,7 +440,8 @@ functions are called."
(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.
@@ -465,6 +466,7 @@ updates before the buffer is saved, use `before-save-hook'.")
'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'.
@@ -4721,13 +4723,15 @@ the last real save, but optional arg FORCE non-nil means delete anyway."
"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)