diff options
-rw-r--r-- | lib/net/jao-notmuch.el | 25 | ||||
-rw-r--r-- | notmuch.org | 1 |
2 files changed, 25 insertions, 1 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index 48ba775..cedd2cf 100644 --- a/lib/net/jao-notmuch.el +++ b/lib/net/jao-notmuch.el @@ -25,6 +25,7 @@ ;;; Code: (require 'eww) +(require 'outline) (require 'notmuch) (require 'notmuch-tree) @@ -167,6 +168,25 @@ (message "No URLs in this message"))))) +;; Outline mode for tree view + +(defun jao-notmuch--setup-outline () + (setq-local outline-regexp ".+ [┬─] ") + (outline-minor-mode 1)) + +(add-hook 'notmuch-tree-mode-hook #'jao-notmuch--setup-outline) + +(defun jao-notmuch--tree-toggle (&rest _args) + (when outline-minor-mode + (outline-toggle-children))) + +(advice-add 'notmuch-tree-matching-message :before #'jao-notmuch--tree-toggle) +(advice-add 'notmuch-tree-matching-message :after #'jao-notmuch--tree-toggle) + +(define-key notmuch-tree-mode-map (kbd "T TAB") 'outline-cycle) +(define-key notmuch-tree-mode-map (kbd "T t") 'outline-cycle) + + ;; Toggling mime parts and images (defun jao-notmuch--toggle-mime () @@ -263,7 +283,10 @@ (let ((buffer (process-buffer proc)) (status (process-status proc))) (when (and (eq status 'exit) (buffer-live-p buffer)) - (with-current-buffer buffer (jao-notmuch--tree-update-buffer-name))))) + (with-current-buffer buffer + (jao-notmuch--tree-update-buffer-name) + (outline-hide-body) + (outline-toggle-children))))) (advice-add 'notmuch-tree-process-sentinel :after #'jao-notmuch--tree-sentinel) diff --git a/notmuch.org b/notmuch.org index c134710..52de0ed 100644 --- a/notmuch.org +++ b/notmuch.org @@ -162,6 +162,7 @@ notmuch-show-all-tags-list t notmuch-show-logo nil notmuch-show-empty-saved-searches nil + notmuch-show-only-matching-messages t notmuch-show-part-button-default-action 'notmuch-show-view-part notmuch-show-mark-read-tags '("-new" "-unread") notmuch-archive-tags '("+trove" "-new") |