From 1087f3e6aac217dac65ba83270a700ee310ab984 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 10 Apr 2002 14:55:19 +0000 Subject: [PATCH] (remove-hook): When there are no more local hooks, kill the buffer-local value. --- lisp/subr.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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. -- 2.39.2