# HG changeset patch # User Richard M. Stallman # Date 780022764 0 # Node ID 0ea4cc4ca33999ed2c55ca85737d99d8bbce91f1 # Parent 4477436f8ba5c7f832f752cd75a67d5de8dfc2de (add-hook): Doc fix. diff -r 4477436f8ba5 -r 0ea4cc4ca339 lisp/subr.el --- a/lisp/subr.el Tue Sep 20 00:26:25 1994 +0000 +++ b/lisp/subr.el Tue Sep 20 00:59:24 1994 +0000 @@ -551,7 +551,15 @@ 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)))