From: Eric Abrahamsen Date: Tue, 7 Sep 2021 18:51:39 +0000 (-0700) Subject: Don't let nndiary.el alter variables when loading file X-Git-Tag: emacs-28.0.90~1116 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6cca705aa6b2ae93da8e0cd0da71f87fe583058c;p=emacs.git 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. --- diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el index adf4427523f..133e0307a54 100644 --- a/lisp/gnus/nndiary.el +++ b/lisp/gnus/nndiary.el @@ -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))