all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#1102: Modification of patch
@ 2008-10-06 18:24 Phil Hagelberg
  2008-10-16  5:54 ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Hagelberg @ 2008-10-06 18:24 UTC (permalink / raw)
  To: 1102


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






^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-07-09 18:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-06 18:24 bug#1102: Modification of patch Phil Hagelberg
2008-10-16  5:54 ` Glenn Morris
2008-10-16 16:09   ` Phil Hagelberg
2008-10-17  1:28     ` Stefan Monnier
2008-10-17  1:35       ` Processed: " Emacs bug Tracking System
2011-07-09 18:46     ` bug#1102: add-hook should check that its function arg is a function Glenn Morris

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.