summaryrefslogtreecommitdiff
path: root/lisp/subr.el
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/subr.el
parent711668ac2d362719657db8a85fa1989545761412 (diff)
* subr.el (add-hook): Robustify to handle closure as well.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index f8b5d605f9..adf3f9a97f 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)