Add config for gnus-alias in notmuch

This commit is contained in:
Adam Goldsmith 2019-08-13 15:42:47 -04:00
parent 89b0cf958f
commit f0564908f4

View File

@ -790,6 +790,30 @@
("k" . previous-line) ("k" . previous-line)
("N" . nm-sticky-tag-and-next)) ("N" . nm-sticky-tag-and-next))
:config :config
(use-package gnus-alias :ensure
:hook (message-mode . gnus-alias-init)
:config
(defun ga-id (alias &rest args)
(list alias
(plist-get args :refers-to)
(plist-get args :from)
(plist-get args :organization)
(plist-get args :extra-headers)
(plist-get args :body)
(plist-get args :signature)))
(setq
gnus-alias-identity-alist
(list
(ga-id "main" :from "Adam Goldsmith <adam@adamgoldsmith.name>")
(ga-id "tsrc" :from "Adam Goldsmith <kc1gdw@adamgoldsmith.name>")
(ga-id "wpi" :from "Adam Goldsmith <asgoldsmith@wpi.edu>")
(ga-id "gmail" :from "Adam Goldsmith <adamgoldsmith1217@gmail.com>")))
(setq
gnus-alias-identity-rules
'(("tsrc" ("any" "tsrc\\@mailman\\.qth\\.net" both) "tsrc")
("WPI" ("any" ".*\\@wpi\\.edu" both) "wpi")))
(setq gnus-alias-default-identity "main"))
(defun nm-tag-and-next (tags) (defun nm-tag-and-next (tags)
"Apply some changes to a message, then move to the next line" "Apply some changes to a message, then move to the next line"
(nm-apply-to-result (lambda (q) (notmuch-tag q tags))) (nm-apply-to-result (lambda (q) (notmuch-tag q tags)))