From ce959d4594c8fa4e0776c182ff2e02356e8a9d1f Mon Sep 17 00:00:00 2001 From: Frederik Vanrenterghem Date: Fri, 3 May 2024 22:50:03 +0800 Subject: [PATCH] Show spam status in mu4e message view. --- emacs/.emacs.d/init.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 4d58dfe..51f86f1 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -135,7 +135,18 @@ (setq mu4e-sent-folder "/Sent" mu4e-drafts-folder "/Drafts" mu4e-trash-folder "/Trash") - +;; Create custom spam status header and show in message view +(add-to-list 'mu4e-header-info-custom + '(:spam-status . + ( :name "Spam-Status" ;; long name, as seen in the message-view + :shortname "Spam" ;; short name, as seen in the headers view + :help "The Spam status" ;; tooltip + ;; uses mu4e-fetch-field which is rel. slow, so only appropriate + ;; for mu4e-view-fields, and _not_ mu4e-headers-fields + :function (lambda (msg) + (or (string-join (seq-take (split-string (mu4e-fetch-field msg "X-Spam-Status") " ") 2) " ") ""))))) +(add-to-list 'mu4e-view-fields :spam-status) +b ;; Load configuration for website ;(load "mustache-html") -- 2.39.5