mu4e-thread: add mu4e-thread-fold-single-children
Allow for customizing the folding of single children.
This commit is contained in:
@ -52,6 +52,13 @@
|
|||||||
:type 'boolean
|
:type 'boolean
|
||||||
:group 'mu4e-headers)
|
:group 'mu4e-headers)
|
||||||
|
|
||||||
|
(defcustom mu4e-thread-fold-single-children nil
|
||||||
|
"If set to t fold even if there is only a single child.
|
||||||
|
Otherwise, do not not fold single children since would simply
|
||||||
|
hide the single child."
|
||||||
|
:type 'number
|
||||||
|
:group 'mu4e-headers)
|
||||||
|
|
||||||
(defface mu4e-thread-fold-face
|
(defface mu4e-thread-fold-face
|
||||||
`((t :inherit mu4e-highlight-face))
|
`((t :inherit mu4e-highlight-face))
|
||||||
"Face for the information line of a folded thread."
|
"Face for the information line of a folded thread."
|
||||||
@ -250,7 +257,7 @@ Reset individual folding states."
|
|||||||
(mu4e-thread--save-state 'folded))
|
(mu4e-thread--save-state 'folded))
|
||||||
(let ((child-count (count-lines fold-beg fold-end))
|
(let ((child-count (count-lines fold-beg fold-end))
|
||||||
(unread-count (if mu4e-thread-fold-unread unread-count 0)))
|
(unread-count (if mu4e-thread-fold-unread unread-count 0)))
|
||||||
(when (> child-count 1)
|
(when (> child-count (if mu4e-thread-fold-single-children 0 1))
|
||||||
(let ((inhibit-read-only t)
|
(let ((inhibit-read-only t)
|
||||||
(overlay (make-overlay fold-beg fold-end))
|
(overlay (make-overlay fold-beg fold-end))
|
||||||
(info (mu4e-thread-fold-info child-count unread-count)))
|
(info (mu4e-thread-fold-info child-count unread-count)))
|
||||||
|
|||||||
Reference in New Issue
Block a user