From: Richard M. Stallman Date: Wed, 10 Apr 2002 14:55:19 +0000 (+0000) Subject: (remove-hook): When there are no more local hooks, X-Git-Tag: ttn-vms-21-2-B4~15716 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1087f3e6aac217dac65ba83270a700ee310ab984;p=emacs.git (remove-hook): When there are no more local hooks, kill the buffer-local value. --- diff --git a/lisp/subr.el b/lisp/subr.el index 5a80298ca59..16359fa87bb 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -808,7 +808,11 @@ This makes the hook buffer-local if needed." ;; (not (member (cons 'not function) hook-value))) ;; (push (cons 'not function) hook-value)) ;; Set the actual variable - (if local (set hook hook-value) (set-default hook hook-value)))) + (if (not local) + (set-default hook hook-value) + (if (equal hook-value '(t)) + (kill-local-variable hook) + (set hook hook-value))))) (defun add-to-list (list-var element &optional append) "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet.