]> git.eshelyaron.com Git - emacs.git/commitdiff
erc-backend.el: Give hook-name a default value of nil and add-to-list unconditionally...
authorDima Kogan <dima@secretsauce.net>
Wed, 14 Jan 2015 21:47:01 +0000 (16:47 -0500)
committerkwhite <kwhite@gnu.org>
Wed, 14 Jan 2015 21:55:44 +0000 (16:55 -0500)
lisp/erc/ChangeLog
lisp/erc/erc-backend.el

index 8c8a3bfae5c99931100b5c994ed7b4db93f2d7a4..8e0c31a7decafb077fb1585a3284ef0bc418c1e6 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-14  Dima Kogan  <dima@secretsauce.net>
+
+       * erc-backend.el (define-erc-response-handler): Give hook-name
+       default value of nil and add-to-list (bug#19363)
+
 2014-11-10  Kelvin White  <kwhite@gnu.org>
 
        * erc-stamp.el (erc-timestamp-intangible): Change version tag to 24.5.
index b8c67860e2014ff2227191a8d6be96f633e1e926..8ce199fbcbb02a57762073333f3e85caca66073f 100644 (file)
@@ -1162,8 +1162,11 @@ add things to `%s' instead."
           (cl-loop for alias in aliases
                    collect (intern (format "erc-server-%s-functions" alias)))))
     `(prog2
-         ;; Normal hook variable.
-         (defvar ,hook-name ',fn-name ,(format hook-doc name))
+         ;; Normal hook variable.  The variable may already have a
+         ;; value at this point, so I default to nil, and (add-hook)
+         ;; unconditionally
+         (defvar ,hook-name nil ,(format hook-doc name))
+         (add-to-list ',hook-name ',fn-name)
          ;; Handler function
          (defun ,fn-name (proc parsed)
            ,fn-doc