summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)