Commit e4da9c1c authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(remove-hook): Don't turn the hook's value into a list.

parent ac266581
2000-05-21 Stefan Monnier <>
* subr.el (remove-hook): Don't turn the hook's value into a list.
2000-05-21 Dave Love <>
* edmacro.el (edmacro-parse-keys): Return vector if any elements
......@@ -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)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment