From cf4a60a3195679829bdc1bde95598420f780bc77 Mon Sep 17 00:00:00 2001 From: Dave Love Date: Mon, 21 Sep 1998 17:57:46 +0000 Subject: [PATCH] (remove-hook): Check list values to avoid errors. --- lisp/subr.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) -- 2.39.2