From 117501d5ceb332063adfeadc961e8c053f2cd942 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Sun, 10 Jan 2021 15:00:53 +0100 Subject: [PATCH] emacs: define notmuch-message-queued-tag-changes as buffer-local Also improve the doc-string. --- emacs/notmuch-message.el | 14 +++++++------- emacs/notmuch-mua.el | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el index f0e9ffcc..9dc8d056 100644 --- a/emacs/notmuch-message.el +++ b/emacs/notmuch-message.el @@ -50,14 +50,14 @@ the \"inbox\" tag, you would set: :type '(repeat string) :group 'notmuch-send) -(defconst notmuch-message-queued-tag-changes nil - "List of messages and corresponding tag-changes to be applied when sending a message. +(defvar-local notmuch-message-queued-tag-changes nil + "List of tag changes to be applied when sending a message. -This variable is overridden by buffer-local versions in message -buffers where tag changes should be triggered when sending off -the message. Each item in this list is a list of strings, where -the first is a notmuch query and the rest are the tag changes to -be applied to the matching messages.") +A list of queries and tag changes that are to be applied to them +when the message that was composed in the current buffer is being +send. Each item in this list is a list of strings, where the +first is a notmuch query and the rest are the tag changes to be +applied to the matching messages.") (defun notmuch-message-apply-queued-tag-changes () ;; Apply the tag changes queued in the buffer-local variable diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index b2930051..95d1965b 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -266,8 +266,8 @@ Typically this is added to `notmuch-mua-send-hook'." ;; Create a buffer-local queue for tag changes triggered when ;; sending the reply. (when notmuch-message-replied-tags - (setq-local notmuch-message-queued-tag-changes - (list (cons query-string notmuch-message-replied-tags)))) + (setq notmuch-message-queued-tag-changes + (list (cons query-string notmuch-message-replied-tags)))) ;; Insert the message body - but put it in front of the signature ;; if one is present, and after any other content ;; message*setup-hooks may have added to the message body already. @@ -507,10 +507,10 @@ the From: address." ;; Create a buffer-local queue for tag changes triggered when ;; sending the message. (when notmuch-message-forwarded-tags - (setq-local notmuch-message-queued-tag-changes - (cl-loop for id in forward-queries - collect - (cons id notmuch-message-forwarded-tags)))) + (setq notmuch-message-queued-tag-changes + (cl-loop for id in forward-queries + collect + (cons id notmuch-message-forwarded-tags)))) ;; `message-forward-make-body' shows the User-agent header. Hide ;; it again. (message-hide-headers) -- 2.43.0