aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-09-20 00:59:24 +0000
committerRichard M. Stallman1994-09-20 00:59:24 +0000
commit2a598462ecee6f6fd7ce5f14b095ff0247f7692d (patch)
tree8876f092090c1a6fdb65540323a3e011c028d451
parente08455275a9859ac679ecc7dbdf89f397ad68d6b (diff)
downloademacs-2a598462ecee6f6fd7ce5f14b095ff0247f7692d.tar.gz
emacs-2a598462ecee6f6fd7ce5f14b095ff0247f7692d.zip
(add-hook): Doc fix.
-rw-r--r--lisp/subr.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index ed93fa4c6a9..e985125263e 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -551,7 +551,15 @@ FUNCTION is added at the end.
551 551
552HOOK should be a symbol, and FUNCTION may be any valid function. If 552HOOK should be a symbol, and FUNCTION may be any valid function. If
553HOOK is void, it is first set to nil. If HOOK's value is a single 553HOOK is void, it is first set to nil. If HOOK's value is a single
554function, it is changed to a list of functions." 554function, it is changed to a list of functions.
555
556Note: if you make a hook variable buffer-local, copy its value before
557you use `add-hook' to add to it. For example,
558
559 (make-local-variable 'foo-hook)
560 (if (boundp 'foo-hook)
561 (setq foo-hook (copy-sequence foo-hook)))
562 (add-hook 'foo-hook 'my-foo-function)"
555 (or (boundp hook) (set hook nil)) 563 (or (boundp hook) (set hook nil))
556 ;; If the hook value is a single function, turn it into a list. 564 ;; If the hook value is a single function, turn it into a list.
557 (let ((old (symbol-value hook))) 565 (let ((old (symbol-value hook)))