]> git.cworth.org Git - notmuch/blobdiff - emacs/notmuch-mua.el
emacs: Use a buffer-local variable to update tags when sending replies
[notmuch] / emacs / notmuch-mua.el
index 23f3d8b12cf10dbca3f6e8cdc8079718fbc04ab5..2f0de92c6ec28f7fb511a1938698685fc41c17c8 100644 (file)
@@ -28,6 +28,7 @@
 (require 'notmuch-lib)
 (require 'notmuch-address)
 (require 'notmuch-draft)
+(require 'notmuch-message)
 
 (eval-when-compile (require 'cl))
 
@@ -259,6 +260,11 @@ Typically this is added to `notmuch-mua-send-hook'."
                            (notmuch-headers-plist-to-alist reply-headers)
                            nil (notmuch-mua-get-switch-function))))
 
+      ;; 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))))
+
       ;; 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.