bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50437: 28.0.50; describe-variable completion loads nndiary; changes


From: Eric Abrahamsen
Subject: bug#50437: 28.0.50; describe-variable completion loads nndiary; changes variable value
Date: Mon, 06 Sep 2021 12:13:32 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Running describe-variable on Gnus-related variables and then TAB
completing in the minibuffer runs `help--symbol-completion-table', which
loads all gnus libraries, including 'gnus-diary, which in turn requires
'nndiary, which alters the values of `gnus-extra-headers' and
`nnmail-extra-headers'. Leading to the weird reported behavior that
inspecting the value of `gnus-extra-headers' can alter the value of
`gnus-extra-headers'.

nndiary.el probably shouldn't alter variable values at load time; the
diff below is one possible solution.


1 file changed, 5 insertions(+), 6 deletions(-)
lisp/gnus/nndiary.el | 11 +++++------

modified   lisp/gnus/nndiary.el
@@ -416,6 +416,11 @@ nndiary-retrieve-headers
 
 (deffoo nndiary-open-server (server &optional defs)
   (nnoo-change-server 'nndiary server defs)
+  (dolist (header nndiary-headers)
+    (setq header (intern (format "X-Diary-%s" (car header))))
+    ;; Required for building NOV databases and some other stuff.
+    (add-to-list 'gnus-extra-headers header)
+    (add-to-list 'nnmail-extra-headers header))
   (when (not (file-exists-p nndiary-directory))
     (ignore-errors (make-directory nndiary-directory t)))
   (cond
@@ -1557,12 +1562,6 @@ nndiary-renew-article-p
 
 ;; The end... ===============================================================
 
-(dolist (header nndiary-headers)
-  (setq header (intern (format "X-Diary-%s" (car header))))
-  ;; Required for building NOV databases and some other stuff.
-  (add-to-list 'gnus-extra-headers header)
-  (add-to-list 'nnmail-extra-headers header))
-
 (unless (assoc "nndiary" gnus-valid-select-methods)
   (gnus-declare-backend "nndiary" 'post-mail 'respool 'address))
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]