Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions mu4e-thread-folding.el
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
:type 'string
:group 'mu4e-thread-folding)

(defcustom mu4e-thread-folding-hide-unread nil
"Whether or not to hide unread messages when folding."
:type 'boolean
:group 'mu4e-thread-folding)

(defcustom mu4e-thread-folding-root-unfolded-prefix-string
"[%2d] ▾"
"Prefix for the root node thread when it is unfolded."
Expand Down Expand Up @@ -250,9 +255,13 @@ Unread message are not folded."
(unread (overlay-get local-child-overlay 'unread)))
(setq child-overlay local-child-overlay)
(when (or (not thread-id) (string= id thread-id))
(if (and root-overlay unread)
(overlay-put root-overlay 'face root-unfolded-face)
(overlay-put child-overlay 'invisible value)))))
(if (and root-overlay
unread
(not mu4e-thread-folding-hide-unread))
;; keep unread visible
(overlay-put root-overlay 'face root-unfolded-face)
;; hide unread
(overlay-put child-overlay 'invisible value)))))
;; Root
(when local-root-overlay
(let ((children-number (or (overlay-get local-root-overlay 'children-number) 1))
Expand Down