From 0fdc64ad1aa5494d1c39daf08c7f6b06df4d8771 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 23 Apr 2023 11:08:26 +0300 Subject: [PATCH] mu4e-thread: add mu4e-thread-fold-single-children Allow for customizing the folding of single children. --- mu4e/mu4e-thread.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mu4e/mu4e-thread.el b/mu4e/mu4e-thread.el index fef95819..9c63f4b3 100644 --- a/mu4e/mu4e-thread.el +++ b/mu4e/mu4e-thread.el @@ -52,6 +52,13 @@ :type 'boolean :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 `((t :inherit mu4e-highlight-face)) "Face for the information line of a folded thread." @@ -250,7 +257,7 @@ Reset individual folding states." (mu4e-thread--save-state 'folded)) (let ((child-count (count-lines fold-beg fold-end)) (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) (overlay (make-overlay fold-beg fold-end)) (info (mu4e-thread-fold-info child-count unread-count)))