From f5185b2860f737a8b782b08569b02de0c3176aa0 Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 5 Jun 2021 01:40:30 +0100 Subject: notmuch tweaks --- email.org | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/email.org b/email.org index 335652f..07ab00a 100644 --- a/email.org +++ b/email.org @@ -303,11 +303,12 @@ (defun jao-notmuch-refresh-hello () (interactive) - (notmuch-refresh-this-buffer) - (let ((inhibit-message t)) - (save-window-excursion (org-agenda-list)) - (beginning-of-buffer) - (widget-forward 2))) + (when (derived-mode-p 'notmuch-hello-mode) + (notmuch-refresh-this-buffer) + (let ((inhibit-message t)) + (save-window-excursion (org-agenda-list)) + (beginning-of-buffer) + (widget-forward 2)))) (defun jao-notmuch-open-enclosure (add) (interactive "P") @@ -324,7 +325,8 @@ (unless add (jao-mpc-play))) (error "Found an enclosure, but not a link!"))))) - :hook ((notmuch-hello-refresh . jao-notmuch-notify)) + :hook ((notmuch-hello-refresh . jao-notmuch-notify) + (jao-afio-switch . jao-notmuch-refresh-hello)) :bind (:map notmuch-hello-mode-map (("S" . consult-notmuch) @@ -371,7 +373,7 @@ ,(jao-notmuch--q "gmane" nil "g" '("tag:gmane" "tag:new")) ,(jao-notmuch--q "bml/today" nil "tb" '("tag:bigml" "date:1d..")) ,(jao-notmuch--q "jao/today" nil "tj" '("tag:jao" "date:1d..")) - ,(jao-notmuch--q "flagged" nil "r" '("tag:flagged")) + ,(jao-notmuch--q "flagged" nil "r" '("tag:flagged") t) ,(jao-notmuch--q "new" nil "n" '("tag:new")) ,(jao-notmuch--q "draft" nil "d" '("tag:draft")))) #+end_src @@ -438,7 +440,7 @@ (defun jao-notmuch-tag-jump-and-next (reverse) (interactive "P") (notmuch-tag-jump reverse) - (jao-notmuch-tree-next)) + (jao-notmuch-tree-next nil t)) (defun jao-notmuch-tree--tag-and-next (tags reverse whole-thread) (let ((c (notmuch-tag-change-list tags reverse))) @@ -650,8 +652,6 @@ notmuch tag +gmane -- tag:new AND folder:/gmane/ - XDG_RUNTIME_DIR='/run/user/1000' \ - /usr/local/bin/emacsclient -e '(jao-notmuch-notify)' > /dev/null #+end_src *** expiry shell script #+begin_src bash :shebang "#!/bin/bash" :tangle ./bin/notmuch-expire.sh :tangle-mode (identity #o755) @@ -669,6 +669,11 @@ notmuch tag +deleted +trash -new -unread -- "folder:trash and tag:new" + notmuch new > $HOME/var/log/notmuch-expire.log 2>&1 + notmuch compact >> $HOME/var/log/notmuch-expire.log 2>&1 + #+end_src +*** delete shell script + #+begin_src bash :shebang "#!/bin/bash" :tangle ./bin/notmuch-delete.sh :tangle-mode (identity #o755) notmuch search --output=files --format=text0 tag:deleted | xargs -r0 rm notmuch new > $HOME/var/log/notmuch-expire.log 2>&1 -- cgit v1.2.3