summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2023-10-30 09:16:46 -0400
committerKjetil Orbekk <kj@orbekk.com>2023-10-30 09:16:46 -0400
commit6b7525e1f91764de09c8fa5b49bce8edc3c8ad3c (patch)
tree25ed8b9f95b451484d9ea20d3d740157f509287e /emacs
parent219b34fb49d2d9c7bf8e6c6c167a46042aabc7f9 (diff)
email changes
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.config/emacs-kj/lisp/kj-email.el40
1 files changed, 39 insertions, 1 deletions
diff --git a/emacs/.config/emacs-kj/lisp/kj-email.el b/emacs/.config/emacs-kj/lisp/kj-email.el
index 2ab75f4..bc694f0 100644
--- a/emacs/.config/emacs-kj/lisp/kj-email.el
+++ b/emacs/.config/emacs-kj/lisp/kj-email.el
@@ -2,10 +2,48 @@
(setq kj/fastmail-maildir (expand-file-name "~/Maildir/fastmail"))
+(setq notmuch-show-all-tags-list t
+ notmuch-show-relative-dates t
+ notmuch-hello-tag-list-make-query "tag:unread"
+ notmuch-archive-tags '("-inbox" "-unread")
+ notmuch-fcc-dirs nil)
+(add-hook 'message-mode-hook 'turn-off-auto-fill)
+(add-hook 'message-mode-hook 'visual-line-mode)
+
+(setq notmuch-saved-searches
+ '((:name "inbox" :query "tag:inbox -tag:_gz" :key "i" :search-type tree)
+ (:name "unread" :query "tag:unread" :key "u" :search-type tree)
+ (:name "flagged" :query "tag:flagged" :key "f" :search-type tree)
+ (:name "sent" :query "tag:sent" :key "t" :search-type tree)
+ (:name "drafts" :query "tag:draft" :key "d" :search-type tree)
+ (:name "all mail" :query "*" :key "a" :search-type tree)
+ (:name "d" :query "tag:d-team tag:inbox" :search-type tree)))
+
+(defun kj/notmuch-tree-by-tag (tag)
+ (interactive
+ (list (notmuch-select-tag-with-completion "Notmuch search tag: ")))
+ (notmuch-tree (concat "tag:" tag)))
+
+(define-key notmuch-hello-mode-map "T"
+ 'kj/notmuch-tree-by-tag)
+
+
+(define-key notmuch-show-mode-map "!"
+ (lambda ()
+ "mark message as spam"
+ (interactive)
+ (notmuch-show-tag (list "+_gz" "-inbox"))))
+
+(define-key notmuch-search-mode-map "!"
+ (lambda (&optional beg end)
+ "mark thread as spam"
+ (interactive (notmuch-interactive-region))
+ (notmuch-search-tag (list "+_gz" "-inbox") beg end)))
+
(when (file-exists-p kj/fastmail-maildir)
(use-package notmuch)
- (setq message-mail-user-agent 'message-user-agent
+ (setq message-mail-user-agent 'notmuch-user-agent
message-kill-buffer-on-exit t
message-send-mail-function 'message-send-mail-with-sendmail)