summaryrefslogtreecommitdiffhomepage
path: root/lib/net
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-08-21 17:19:41 +0100
committerjao <jao@gnu.org>2022-08-21 17:19:41 +0100
commit54397065b201c5dd35e0b6b6ea95f875065451c2 (patch)
treed24af4e09d12e48ad0b6bdbb7500304d77b196d2 /lib/net
parent20fb0d971569293031be113b84695349d154faad (diff)
downloadelibs-54397065b201c5dd35e0b6b6ea95f875065451c2.tar.gz
elibs-54397065b201c5dd35e0b6b6ea95f875065451c2.tar.bz2
notmuch: better ad-hoc fcc handling
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/jao-notmuch.el18
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)