summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/net/jao-notmuch.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index bd48e8f..6344eab 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -414,6 +414,24 @@
(jao-notmuch-tree--tag tags nil nil)
(jao-notmuch-tree--next nil nil t t)))
+(defvar jao-notmuch-mua-reply-not-inherited
+ '("attachment" "sent" "new" "unread"))
+
+(defun jao-notmuch--append-to-fcc (suffix)
+ (mapcar (lambda (e)
+ (let ((r (cdr e)))
+ (if (stringp r) (cons (car e) (concat r " " suffix)) e)))
+ notmuch-fcc-dirs))
+
+(defun jao-notmuch-mua-new-reply (fun &rest args)
+ (let* ((tags (seq-difference (notmuch-show-get-tags)
+ jao-notmuch-mua-reply-not-inherited))
+ (tagstr (mapconcat (lambda (s) (concat "+" s)) tags " "))
+ (notmuch-fcc-dirs (jao-notmuch--append-to-fcc tagstr)))
+ (apply fun args)))
+
+(advice-add 'notmuch-mua-new-reply :around #'jao-notmuch-mua-new-reply)
+
;;;; Results formatters