changeset 23294:ce2cac0f1682

(remove-hook): Check list values to avoid errors.
author Dave Love <fx@gnu.org>
date Mon, 21 Sep 1998 17:57:46 +0000
parents 34dc05f50ea3
children 722f0b9703c7
files lisp/subr.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Mon Sep 21 17:43:57 1998 +0000
+++ b/lisp/subr.el	Mon Sep 21 17:57:46 1998 +0000
@@ -653,7 +653,8 @@
 	    ;; 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 @@
 		(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)