summaryrefslogtreecommitdiffhomepage
path: root/lib/net
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-11-10 21:33:14 +0000
committerjao <jao@gnu.org>2022-11-10 21:34:11 +0000
commit5300330a27ce64f43b0ed36a9fa0a49158d19c6a (patch)
tree7a39c7b3efe155bfc5263d993a3c1dd6a95867a7 /lib/net
parent1de3153eee916b18a069ad08519a067000e35c2e (diff)
downloadelibs-5300330a27ce64f43b0ed36a9fa0a49158d19c6a.tar.gz
elibs-5300330a27ce64f43b0ed36a9fa0a49158d19c6a.tar.bz2
email adjustments, and fcc in notmuch based on current folder
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/jao-notmuch.el16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index 48a8ff8..1e9eb4c 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -1,4 +1,4 @@
-;; jao-notmuch.el --- Extensions for notmuch -*- lexical-binding: t; -*-
+;;; jao-notmuch.el --- Extensions for notmuch -*- lexical-binding: t; -*-
;; Copyright (C) 2021, 2022 jao
@@ -328,6 +328,7 @@
(let ((tags (plist-get (notmuch-tree-get-message-properties) :orig-tags)))
(jao-notmuch-tree--tag tags nil)))
+;;; fcc
(defvar jao-notmuch-mua-reply-not-inherited
'("attachment" "sent" "new" "bigml" "jao" "trove"))
@@ -342,9 +343,20 @@
(fcc-dirs (assoc-delete-all ".*" (copy-alist notmuch-fcc-dirs))))
(append fcc-dirs `((".*" . ,fcc)))))
+(defun jao-notmuch-mua--inherited-fcc ()
+ (let* ((fn (notmuch-show-get-filename))
+ (dest (and (string-match ".*/var/mail/\\(.+?\\)/.+" fn)
+ (match-string 1 fn)))
+ (tags (seq-difference (notmuch-show-get-tags)
+ '("attachment" "sent" "new" "flagged")))
+ (tagstr (mapconcat (lambda (s) (concat "+" s)) tags " "))
+ (fcc (concat dest " " tagstr " -new +sent +trove"))
+ (fcc-dirs (assoc-delete-all ".*" (copy-alist notmuch-fcc-dirs))))
+ (append fcc-dirs `((".*" . ,fcc)))))
+
(defun jao-notmuch-mua-new-reply (fun &rest args)
(let ((notmuch-fcc-dirs (and (not (notmuch-show-get-header :List-Id))
- (jao-notmuch-mua--fcc-dirs))))
+ (jao-notmuch-mua--inherited-fcc))))
(apply fun args)))
(advice-add 'notmuch-mua-new-reply :around #'jao-notmuch-mua-new-reply)