mu4e: allow for displaying labels

Basic support for displaying labels.
This commit is contained in:
Dirk-Jan C. Binnema
2025-08-26 18:52:04 +03:00
committed by Seth Ladygo
parent 5a6ca68846
commit e6371ff705
3 changed files with 12 additions and 7 deletions

View File

@ -581,7 +581,7 @@ e.g. \"mutt\"."
(mu4e-msg-field msg :date))))
(:flags (propertize (mu4e~headers-flags-str val)
'help-echo (format "%S" val)))
(:tags (propertize (mapconcat 'identity val ", ")))
((:labels :tags) (propertize (mapconcat 'identity val ", ")))
(:size (mu4e-display-size val))
(t (mu4e~headers-custom-field-value msg field)))))

View File

@ -267,6 +267,11 @@ Foo\")."
:shortname "Maildir"
:help "Maildir for this message"
:sortable t))
(:labels
. (:name "Labels"
:shortname "Lbs"
:help "Labels for the message"
:sortable nil))
(:list
. (:name "List-Id"
:shortname "List"

View File

@ -823,12 +823,12 @@ Note that for some messages, this can trigger high CPU load."
(':mailing-list
(let ((list (plist-get msg :list)))
(if list (mu4e-get-mailing-list-shortname list) "")))
((or ':flags ':tags)
(let ((flags (mapconcat (lambda (flag)
(if (symbolp flag)
(symbol-name flag)
flag)) fieldval ", ")))
(mu4e--view-gnus-insert-header field flags)))
((or ':flags ':labels ':tags)
(let ((items (mapconcat (lambda (item)
(if (symbolp item)
(symbol-name item)
item)) fieldval ", ")))
(mu4e--view-gnus-insert-header field items)))
(':size (mu4e--view-gnus-insert-header
field (mu4e-display-size fieldval)))
((or ':subject ':to ':from ':cc ':bcc ':from-or-to