mu4e-headers: sort threaded headers by date

In "threaded-mode", we only sort by date; reflect this in the UI.
This commit is contained in:
Dirk-Jan C. Binnema 2021-02-16 19:34:05 +02:00
parent 98abcf8e84
commit 9367a4dd95
1 changed files with 5 additions and 3 deletions

View File

@ -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)))