From: Dave Love Date: Mon, 21 Sep 1998 17:57:46 +0000 (+0000) Subject: (remove-hook): Check list values to avoid errors. X-Git-Tag: emacs-20.4~1655 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cf4a60a3195679829bdc1bde95598420f780bc77;p=emacs.git (remove-hook): Check list values to avoid errors. --- diff --git a/lisp/subr.el b/lisp/subr.el index 826f52a85ff..f92e78d9afb 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -653,7 +653,8 @@ To make a hook variable buffer-local, always use ;; Detect the case where make-local-variable was used on a hook ;; and do what we used to do. (and (local-variable-p hook) - (not (memq t (symbol-value hook))))) + (consp (symbol-value hook)) + (not (memq t (symbol-value hook))))) (let ((hook-value (symbol-value hook))) (if (consp hook-value) (if (member function hook-value) @@ -662,7 +663,7 @@ To make a hook variable buffer-local, always use (setq hook-value nil))) (set hook hook-value)) (let ((hook-value (default-value hook))) - (if (consp hook-value) + (if (and (consp hook-value) (not (functionp hook-value))) (if (member function hook-value) (setq hook-value (delete function (copy-sequence hook-value)))) (if (equal hook-value function)