From 9857d18b29038c53875b59c18d2c7ab6c96d8a69 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Thu, 8 Dec 2022 21:52:32 +0200 Subject: [PATCH] mu4e-headers: fallback to :subject for :thread-subject If we're not showing threads, use the normal subject. Fixes #2341. --- mu4e/mu4e-headers.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index c747ff75..37a32c0d 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -567,7 +567,7 @@ and `mu4e-headers-time-format'." Otherwise, return the thread-prefix without the subject-text. In other words, show the subject of a thread only once, similar to e.g. \"mutt\"." - (let* ((tinfo (mu4e-message-field msg :meta)) + (let* ((tinfo (mu4e-message-field msg :meta)) (subj (mu4e-msg-field msg :subject))) (concat ;; prefix subject with a thread indicator (mu4e~headers-thread-prefix tinfo) @@ -600,7 +600,10 @@ found." ;; work-around: emacs' display gets really slow when lines are too long; ;; so limit subject length to 600 (truncate-string-to-width val 600))) - (:thread-subject (mu4e~headers-thread-subject msg)) + (:thread-subject ;; if not searching threads, fall back to :subject + (if mu4e-search-threads + (mu4e~headers-thread-subject msg) + (mu4e~headers-field-value msg :subject))) ((:maildir :path :message-id) val) ((:to :from :cc :bcc) (mu4e~headers-contact-str val)) ;; if we (ie. `user-mail-address' is the 'From', show