1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Don't let nndiary.el alter variables when loading file

* lisp/gnus/nndiary.el (nndiary-open-server): Move the manipulation of
`gnus-extra-headers' and `nnmail-extra-headers' into this function: it
should only happen if we're actually firing up an nndiary server.
Previously, simply attempting to complete a gnus-* prefixed symbol
could end up loading this file, and changing the variable values.
This commit is contained in:
Eric Abrahamsen 2021-09-07 11:51:39 -07:00
parent 0cd410fb82
commit 6cca705aa6

View file

@ -416,6 +416,11 @@ all. This may very well take some time.")
(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 @@ all. This may very well take some time.")
;; 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))