]> git.eshelyaron.com Git - emacs.git/commitdiff
Clarify manual and `add-hook' doc string about buffer-local hooks
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 13 Jul 2011 21:38:56 +0000 (23:38 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 13 Jul 2011 21:38:56 +0000 (23:38 +0200)
doc/emacs/ChangeLog
doc/emacs/custom.texi
lisp/ChangeLog
lisp/subr.el

index 0102e028d4950365cd9266cdba837e3baf8e7ad0..e21a02f700f3bb3e2c1c05504b7e593e4b4adf5e 100644 (file)
@@ -1,3 +1,7 @@
+2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * custom.texi (Hooks): Mention buffer-local hooks (bug#6218).
+
 2011-07-13  Glenn Morris  <rgm@gnu.org>
 
        * dired.texi (Dired Enter): Mention --dired.  (Bug#9039)
index 8465dd93519c2f7e364810235ed4db938a1c0b81..6a6d465438de10f8bfed158b85f1308bce2234c5 100644 (file)
@@ -820,6 +820,12 @@ the versions you added will remain in the hook variable together.  You
 can clear out individual functions by calling @code{remove-hook}, or
 do @code{(setq @var{hook-variable} nil)} to remove everything.
 
+@cindex buffer-local hooks
+  If the hook variable is buffer-local, the buffer-local variable will
+be used instead of the global variable.  However, if the buffer-local
+variable contains the element @code{t}, the global hook variable will
+be run as well.
+
 @node Locals
 @subsection Local Variables
 
index 41a7f0b1d2e3ef3de71098ff1cac36415e5cc63e..be42c4b8b2a3a13efc113ca470b3ba5bdadbc37a 100644 (file)
@@ -1,5 +1,8 @@
 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * subr.el (add-hook): Clarify section about buffer-local hooks
+       (bug#6218).
+
        * dired.el (dired-flagged): Clarify doc string (bug#6117).
 
 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
index 5c9d6c8d7249e0f5f88908e4d6c76a73bc29bb6e..a2f560461ebb1ba315157cebf38cff3abbb33dff 100644 (file)
@@ -1262,10 +1262,10 @@ unless the optional argument APPEND is non-nil, in which case
 FUNCTION is added at the end.
 
 The optional fourth argument, LOCAL, if non-nil, says to modify
-the hook's buffer-local value rather than its default value.
-This makes the hook buffer-local if needed, and it makes t a member
-of the buffer-local value.  That acts as a flag to run the hook
-functions in the default value as well as in the local value.
+the hook's buffer-local value rather than its global value.
+This makes the hook buffer-local, and it makes t a member of the
+buffer-local value.  That acts as a flag to run the hook
+functions of the global value as well as in the local value.
 
 HOOK should be a symbol, and FUNCTION may be any valid function.  If
 HOOK is void, it is first set to nil.  If HOOK's value is a single