]> git.eshelyaron.com Git - emacs.git/commitdiff
(remove-hook): When there are no more local hooks,
authorRichard M. Stallman <rms@gnu.org>
Wed, 10 Apr 2002 14:55:19 +0000 (14:55 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 10 Apr 2002 14:55:19 +0000 (14:55 +0000)
kill the buffer-local value.

lisp/subr.el

index 5a80298ca59fdf104646d937a3bdf9dd0a7dbb19..16359fa87bbc44ba5662fd8edddfec91cd7a9736 100644 (file)
@@ -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.