From 54397065b201c5dd35e0b6b6ea95f875065451c2 Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 21 Aug 2022 17:19:41 +0100 Subject: notmuch: better ad-hoc fcc handling --- lib/net/jao-notmuch.el | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'lib/net') diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index db3751f..f8a4648 100644 --- a/lib/net/jao-notmuch.el +++ b/lib/net/jao-notmuch.el @@ -412,19 +412,17 @@ (jao-notmuch-tree--next nil nil t t))) (defvar jao-notmuch-mua-reply-not-inherited - '("attachment" "sent" "new" "unread" "bigml" "jao")) - -(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)) + '("attachment" "sent" "new" "unread" "bigml" "jao" "trove")) (defun jao-notmuch-mua-new-reply (fun &rest args) - (let* ((tags (seq-difference (notmuch-show-get-tags) - jao-notmuch-mua-reply-not-inherited)) + (let* ((otags (notmuch-show-get-tags)) + (trove (or (seq-some (lambda (x) (and (member x otags) x)) + '("hacking" "bills" "feeds" "jao" "bigml")) + "jao")) + (tags (seq-difference otags jao-notmuch-mua-reply-not-inherited)) (tagstr (mapconcat (lambda (s) (concat "+" s)) tags " ")) - (notmuch-fcc-dirs (jao-notmuch--append-to-fcc tagstr))) + (fcc (concat "trove/" trove " " tagstr " -new -unread +sent +trove")) + (notmuch-fcc-dirs (append notmuch-fcc-dirs `((".*" . ,fcc))))) (apply fun args))) (advice-add 'notmuch-mua-new-reply :around #'jao-notmuch-mua-new-reply) -- cgit v1.2.3