summaryrefslogtreecommitdiff
path: root/.emacs.d/init.el
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-05-02 16:44:45 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-05-02 16:44:45 -0700
commit38d45d8951e7b4420ff7e40a495258bf4f83ed68 (patch)
tree0d2a12853e5af1d9e245b5560d54c3308438a09a /.emacs.d/init.el
parent711e19364672682067171154a99a0e306eaa45cf (diff)
downloaddotfiles-38d45d8951e7b4420ff7e40a495258bf4f83ed68.tar.gz
implement catching up notmuch-tree views
Diffstat (limited to '.emacs.d/init.el')
-rw-r--r--.emacs.d/init.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index b561b506..33d40d6e 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -1353,6 +1353,20 @@ Passes ARG to `projectile-switch-project-by-name'."
(use-package notmuch-tree
:commands notmuch-tree
:config
+ ;; use on views produced by `spw--next-unread-group', and only after
+ ;; emptying weekday unread view, so that messages which fall into
+ ;; both `spw--lists-readall' and the current view will not
+ ;; accidentally get marked as read
+ (defun spw--notmuch-tree-catchup ()
+ (interactive)
+ (when (and (eq major-mode 'notmuch-tree-mode)
+ (y-or-n-p (concat "Are you sure you want to mark all as read?"
+ " (should be used only after emptying"
+ " weekday unread view)")))
+ (notmuch-tag (notmuch-tree-get-query) '("-unread"))
+ (notmuch-refresh-this-buffer)))
+ (bind-key "C" 'spw--notmuch-tree-catchup notmuch-tree-mode-map)
+
(bind-key "<f9>" 'spw--next-unread-group notmuch-tree-mode-map))
(use-package notmuch-hello