From: Richard M. Stallman Date: Tue, 20 Sep 1994 00:59:24 +0000 (+0000) Subject: (add-hook): Doc fix. X-Git-Tag: emacs-19.34~6926 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2a598462ecee6f6fd7ce5f14b095ff0247f7692d;p=emacs.git (add-hook): Doc fix. --- 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. 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 -function, it is changed to a list of functions." +function, it is changed to a list of functions. + +Note: if you make a hook variable buffer-local, copy its value before +you use `add-hook' to add to it. For example, + + (make-local-variable 'foo-hook) + (if (boundp 'foo-hook) + (setq foo-hook (copy-sequence foo-hook))) + (add-hook 'foo-hook 'my-foo-function)" (or (boundp hook) (set hook nil)) ;; If the hook value is a single function, turn it into a list. (let ((old (symbol-value hook)))