summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2013-09-18 09:27:00 +0800
committerLeo Liu <sdl.web@gmail.com>2013-09-18 09:27:00 +0800
commit9f25cb774999615410049cbe9382537e7e6ef074 (patch)
treedcc185fb5db62c92b1709e783a1a99503dbff9a7 /lisp
parent711668ac2d362719657db8a85fa1989545761412 (diff)
downloademacs-9f25cb774999615410049cbe9382537e7e6ef074.tar.gz
* subr.el (add-hook): Robustify to handle closure as well.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/subr.el2
2 files changed, 5 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 94987adcfb6..7b2ed1fe6a1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2013-09-18 Leo Liu <sdl.web@gmail.com>
+
+ * subr.el (add-hook): Robustify to handle closure as well.
+
2013-09-17 Glenn Morris <rgm@gnu.org>
* simple.el (messages-buffer-mode-map): Unbind "g".
diff --git a/lisp/subr.el b/lisp/subr.el
index f8b5d605f91..adf3f9a97f2 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1366,7 +1366,7 @@ function, it is changed to a list of functions."
(setq local t)))
(let ((hook-value (if local (symbol-value hook) (default-value hook))))
;; If the hook value is a single function, turn it into a list.
- (when (or (not (listp hook-value)) (eq (car hook-value) 'lambda))
+ (when (or (not (listp hook-value)) (functionp hook-value))
(setq hook-value (list hook-value)))
;; Do the actual addition if necessary
(unless (member function hook-value)