From d132c7b6583a62e702bac16e16d714fb0674934e Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Wed, 14 Jan 2015 16:47:01 -0500 Subject: [PATCH] erc-backend.el: Give hook-name a default value of nil and add-to-list unconditionally. Fixes debbugs:19363 --- lisp/erc/ChangeLog | 5 +++++ lisp/erc/erc-backend.el | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 8c8a3bfae5c..8e0c31a7dec 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,8 @@ +2015-01-14 Dima Kogan + + * 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 * erc-stamp.el (erc-timestamp-intangible): Change version tag to 24.5. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index b8c67860e20..8ce199fbcbb 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -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 -- 2.11.4.GIT