unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Phil Hagelberg <phil@hagelb.org>
To: 1102@emacsbugs.donarmstrong.com
Subject: bug#1102: Modification of patch
Date: Mon, 06 Oct 2008 11:24:22 -0700	[thread overview]
Message-ID: <873aj9mvjd.fsf@hagelb.org> (raw)


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






             reply	other threads:[~2008-10-06 18:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-06 18:24 Phil Hagelberg [this message]
2008-10-16  5:54 ` bug#1102: Modification of patch 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873aj9mvjd.fsf@hagelb.org \
    --to=phil@hagelb.org \
    --cc=1102@emacsbugs.donarmstrong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).