diff options
-rw-r--r-- | lib/net/jao-notmuch.el | 18 |
1 files changed, 8 insertions, 10 deletions
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) |