diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2000-05-21 23:24:18 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2000-05-21 23:24:18 +0000 |
commit | e4da9c1c34f9765b4d067886e8dd7c9a82cc8604 (patch) | |
tree | f70653c79a9b2b73a847e2434b7cda1ec436eb4f /lisp/subr.el | |
parent | ac2665815a33a8bd106741f13e06dcdd0033ea41 (diff) | |
download | emacs-e4da9c1c34f9765b4d067886e8dd7c9a82cc8604.tar.gz |
(remove-hook): Don't turn the hook's value into a list.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r-- | lisp/subr.el | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 65d26d2007a..e33d2b027f5 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -733,11 +733,10 @@ To make a hook variable buffer-local, always use (unless (and (consp (symbol-value hook)) (memq t (symbol-value hook))) (setq local t))) (let ((hook-value (if local (symbol-value hook) (default-value hook)))) - ;; If the hook value is a single function, turn it into a list. - (when (or (not (listp hook-value)) (eq (car hook-value) 'lambda)) - (setq hook-value (list hook-value))) - ;; Do the actual removal if necessary - (setq hook-value (delete function (copy-sequence hook-value))) + ;; Remove the function, for both the list and the non-list cases. + (if (or (not (listp hook-value)) (eq (car hook-value) 'lambda)) + (if (equal hook-value function) (setq hook-value nil)) + (setq hook-value (delete function (copy-sequence hook-value)))) ;; If the function is on the global hook, we need to shadow it locally ;;(when (and local (member function (default-value hook)) ;; (not (member (cons 'not function) hook-value))) |