Mercurial > emacs
changeset 9202:92d6de82426a
(add-hook, remove-hook): If the hook was made local
in the old way, always modify the local value.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 01 Oct 1994 04:36:28 +0000 |
parents | 3af00d95faac |
children | 3e723aa945eb |
files | lisp/subr.el |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/subr.el Sat Oct 01 04:30:14 1994 +0000 +++ b/lisp/subr.el Sat Oct 01 04:36:28 1994 +0000 @@ -652,7 +652,11 @@ (let ((old (symbol-value hook))) (if (or (not (listp old)) (eq (car old) 'lambda)) (set hook (list old)))) - (if local + (if (or local + ;; Detect the case where make-local-variable was used on a hook + ;; and do what we used to do. + (and (local-variable-p hook) + (not (memq t (symbol-value hook))))) ;; Alter the local value only. (or (if (consp function) (member function (symbol-value hook)) @@ -687,7 +691,11 @@ (null (symbol-value hook)) ;value is nil, or (null function)) ;function is nil, then nil ;Do nothing. - (if local + (if (or local + ;; Detect the case where make-local-variable was used on a hook + ;; and do what we used to do. + (and (local-variable-p hook) + (not (memq t (symbol-value hook))))) (let ((hook-value (symbol-value hook))) (if (consp hook-value) (if (member function hook-value)