From 6cca705aa6b2ae93da8e0cd0da71f87fe583058c Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Tue, 7 Sep 2021 11:51:39 -0700 Subject: [PATCH] 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. --- lisp/gnus/nndiary.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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)) -- 2.39.2