From 74437b6374f5d834ad0e84895d4c2a9dfcf56e9d Mon Sep 17 00:00:00 2001 From: Marcelo Henrique Cerri Date: Wed, 19 Jan 2022 16:55:28 -0300 Subject: [PATCH] mu4e-headers: Add mu4e-headers-thread-mark-as-orphan option To mark only the first message in the thread as orphan, allowing to replicate the thread structure used by mutt and other clients. --- mu4e/mu4e-headers.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index e478d8bc..520f30f1 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -207,6 +207,11 @@ chronologically (`:date') by the newest message in the thread.") ;;;; Graph drawing +(defvar mu4e-headers-thread-mark-as-orphan 'all + "Define which messages should be prefixed with the orphan mark. +`all' marks all the messages without a parent as orphan, `first' only +marks the first message in the thread.") + (defvar mu4e-headers-thread-root-prefix '("* " . "□ ") "Prefix for root messages.") (defvar mu4e-headers-thread-child-prefix '("|>" . "│ ") @@ -451,7 +456,10 @@ with DOCID which must be present in the headers buffer." ;; Current entry. (mu4e~headers-thread-prefix-map (if single-orphan 'single-orphan - (if orphan 'orphan + (if (and orphan + (or first-child + (not (eq mu4e-headers-thread-mark-as-orphan 'first)))) + 'orphan (if last-child 'last-child (if first-child 'first-child 'child)))))))))