From 28bc9430ce6342d210e986586af7b6f12e103043 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Wed, 31 Dec 2014 08:13:57 -0800 Subject: [PATCH] ERC no longer gets confused by (eval-after-load 'erc ...) ERC was initializing one of its lists with (defvar list default). If the list already had a value due to (eval-after-load 'erc ...) for instance, then (defvar) would see an initialized variable, and would NOT add the default value to the list. This was breaking things. This patch changes the above defvar idiom to (defvar list nil) (add-to-list 'list default) This way the default value is added to the list unconditionally Closes: #19363 --- lisp/erc/erc-backend.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index fa95d7e..43e56c0 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -1179,8 +1179,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.1.3