]> git.eshelyaron.com Git - emacs.git/commitdiff
* subr.el (add-hook): Robustify to handle closure as well.
authorLeo Liu <sdl.web@gmail.com>
Wed, 18 Sep 2013 01:27:00 +0000 (09:27 +0800)
committerLeo Liu <sdl.web@gmail.com>
Wed, 18 Sep 2013 01:27:00 +0000 (09:27 +0800)
lisp/ChangeLog
lisp/subr.el

index 94987adcfb6cc8c945c62709272fcbca398e1e4c..7b2ed1fe6a1786a1e77295cb0403ad4e088af4e7 100644 (file)
@@ -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".
index f8b5d605f91e1b65f91348ff8b03cf1ff77d1128..adf3f9a97f24d269ef106a9e4a1829e5a6501a8b 100644 (file)
@@ -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)