only show unread messages in notmuch-show threads (fold read msgs)

This commit is contained in:
Max Nickel 2019-10-23 22:58:51 -04:00
parent 07d219a300
commit 5324cb2fc8
2 changed files with 22 additions and 0 deletions

View file

@ -92,6 +92,25 @@
(start-process-shell-command "email" nil (format "xdg-open '%s'" temp))))
;;;###autoload
(defun +notmuch/show-filter-thread ()
"Show the current thread with a different filter"
(interactive)
(setq notmuch-show-query-context (notmuch-read-query "Filter thread: "))
(notmuch-show-refresh-view t))
;;;###autoload
(defun +notmuch-expand-only-unread-h ()
(interactive)
(let ((unread nil)
(open (notmuch-show-get-message-ids-for-open-messages)))
(notmuch-show-mapc (lambda ()
(when (member "unread" (notmuch-show-get-tags))
(setq unread t))))
(when unread
(let ((notmuch-show-hook (remove '+notmuch/expand-only-unread-hook notmuch-show-hook)))
(notmuch-show-filter-thread "tag:unread")))))
;;
;; Advice