summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1996-01-09 23:17:37 +0000
committerKarl Heuer <kwzh@gnu.org>1996-01-09 23:17:37 +0000
commit0c0c0c4a592065ce574a3408ec969c1bd68dee2f (patch)
tree200f9f8a31f999eeb09194f425541045eb374baf /lisp/files.el
parentc598a84479759e8f247eeb1bf9f436b4752c3c34 (diff)
downloademacs-0c0c0c4a592065ce574a3408ec969c1bd68dee2f.tar.gz
(write-contents-hooks): Call make-variable-buffer-local.
Doc fix. (local-write-file-hooks, write-file-hooks): Doc fixes.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el22
1 files changed, 16 insertions, 6 deletions
diff --git a/lisp/files.el b/lisp/files.el
index e512b75adc5..c0f5c718b5f 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -194,15 +194,21 @@ 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.
So this list is cleared if you change the visited file name.
-See also `write-contents-hooks'.
-Don't make this variable buffer-local; instead, use `local-write-file-hooks'.")
+
+Don't make this variable buffer-local; instead, use `local-write-file-hooks'.
+See also `write-contents-hooks'.")
;;; However, in case someone does make it local...
(put 'write-file-hooks 'permanent-local t)
(defvar local-write-file-hooks nil
"Just like `write-file-hooks', except intended for per-buffer use.
The functions in this list are called before the ones in
-`write-file-hooks'.")
+`write-file-hooks'.
+
+This variable is meant to be used for hooks that have to do with a
+particular visited file. Therefore, it is a permanent local, so that
+changing the major mode does not clear it. However, calling
+`set-visited-file-name' does clear it.")
(make-variable-buffer-local 'local-write-file-hooks)
(put 'local-write-file-hooks 'permanent-local t)
@@ -210,10 +216,14 @@ The functions in this list are called before the ones in
"List of functions to be called before writing out a buffer to a file.
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 buffer's contents,
-not to the particular visited file; thus, `set-visited-file-name' does
-not clear this variable, but changing the major mode does clear it.
+
+This variable is meant to be used for hooks that pertain to the
+buffer's contents, not to the particular visited file; thus,
+`set-visited-file-name' does not clear this variable; but changing the
+major mode does clear it if you have made it buffer local.
+
See also `write-file-hooks'.")
+(make-variable-buffer-local 'write-contents-hooks)
(defconst enable-local-variables t
"*Control use of local-variables lists in files you visit.