From 9367a4dd9506070ead12cf53772995ff18277e38 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 16 Feb 2021 19:34:05 +0200 Subject: [PATCH] mu4e-headers: sort threaded headers by date In "threaded-mode", we only sort by date; reflect this in the UI. --- mu4e/mu4e-headers.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index 158f8671..839381e2 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -1073,18 +1073,20 @@ after the end of the search results." (+ mu4e~mark-fringe-len (floor (fringe-columns 'left t))) ?\s) (mapcar (lambda (item) - (let* ((field (car item)) (width (cdr item)) + (let* ( ;; with threading enabled, we're necessarily sorting by date. + (sort-field (if mu4e-headers-show-threads :date mu4e-headers-sort-field)) + (field (car item)) (width (cdr item)) (info (cdr (assoc field (append mu4e-header-info mu4e-header-info-custom)))) (require-full (plist-get info :require-full)) (sortable (plist-get info :sortable)) ;; if sortable, it is either t (when field is sortable itself) ;; or a symbol (if another field is used for sorting) - (sortfield (when sortable (if (booleanp sortable) field sortable))) + (this-field (when sortable (if (booleanp sortable) field sortable))) (help (plist-get info :help)) ;; triangle to mark the sorted-by column (arrow - (when (and sortable (eq sortfield mu4e-headers-sort-field)) + (when (and sortable (eq this-field sort-field)) (if (eq mu4e-headers-sort-direction 'descending) downarrow uparrow))) (name (concat (plist-get info :shortname) arrow)) (map (make-sparse-keymap)))