Subject: bug#1102: Modification of patch

From: Phil Hagelberg <[email-masked]>
Date: Mon, 06 Oct 2008 11:24:22 -0700

Changed the patch from the initial bug report.

add-hook should allow symbols since it's reasonable to refer to
functions that haven't been defined yet.

-Phil

diff --git a/lisp/subr.el b/lisp/subr.el
index d62b38b..d315c27 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1132,6 +1132,8 @@ HOOK is void, it is first set to nil.  If HOOK's value is a single
 function, it is changed to a list of functions."
   (or (boundp hook) (set hook nil))
   (or (default-boundp hook) (set-default hook nil))
+  (unless (or (functionp function) (symbolp function))
+              (error "`function' argument was not a function"))
   (if local (unless (local-variable-if-set-p hook)
 	      (set (make-local-variable hook) (list t)))
     ;; Detect the case where make-local-variable was used on a hook