mu4e: add custom variable for list of visible flags to display in headers view

This commit is contained in:
2013-02-21 11:46:23 -08:00
parent 55619550e9
commit 9944a4fd62

View File

@ -127,6 +127,25 @@ sent messages into message threads."
:type 'boolean :type 'boolean
:group 'mu4e-headers) :group 'mu4e-headers)
(defcustom mu4e-headers-visible-flags
'('draft 'flagged 'new 'passed 'replied 'seen 'trashed 'attach 'encrypted 'signed 'unread)
"An ordered list of flags to show in the headers buffer. Each
element is a symbol in the list (DRAFT FLAGGED NEW PASSED
REPLIED SEEN TRASHED ATTACH ENCRYPTED SIGNED UNREAD)."
:type '(set
(const :tag "Draft" 'draft)
(const :tag "Flagged" 'flagged)
(const :tag "New" 'new)
(const :tag "Passed" 'passed)
(const :tag "Replied" 'replied)
(const :tag "Seen" 'seen)
(const :tag "Trashed" 'trashed)
(const :tag "Attach" 'attach)
(const :tag "Encrypted" 'encrypted)
(const :tag "Signed" 'signed)
(const :tag "Unread" 'unread))
:group 'mu4e-headers)
;; marks for headers of the form; each is a cons-cell (basic . fancy) ;; marks for headers of the form; each is a cons-cell (basic . fancy)
;; each of which is basic ascii char and something fancy, respectively ;; each of which is basic ascii char and something fancy, respectively
(defvar mu4e-headers-draft-mark (purecopy '("D" . "")) "Draft.") (defvar mu4e-headers-draft-mark (purecopy '("D" . "")) "Draft.")
@ -322,25 +341,26 @@ Note that `mu4e-flags-to-string' is for internal use only; this
function is for display. (This difference is significant, since function is for display. (This difference is significant, since
internally, the Maildir spec determines what the flags look like, internally, the Maildir spec determines what the flags look like,
while our display may be different)." while our display may be different)."
(let ((str) (let ((str "")
(get-prefix (get-prefix
(lambda (cell) (if mu4e-use-fancy-chars (cdr cell) (car cell))))) (lambda (cell) (if mu4e-use-fancy-chars (cdr cell) (car cell)))))
(dolist (flag flags) (dolist (flag mu4e-headers-visible-flags)
(setq str (when (member flag flags)
(concat str (setq str
(case flag (concat str
('draft (funcall get-prefix mu4e-headers-draft-mark)) (case flag
('flagged (funcall get-prefix mu4e-headers-flagged-mark)) ('draft (funcall get-prefix mu4e-headers-draft-mark))
('new (funcall get-prefix mu4e-headers-new-mark)) ('flagged (funcall get-prefix mu4e-headers-flagged-mark))
('passed (funcall get-prefix mu4e-headers-passed-mark)) ('new (funcall get-prefix mu4e-headers-new-mark))
('replied (funcall get-prefix mu4e-headers-replied-mark)) ('passed (funcall get-prefix mu4e-headers-passed-mark))
('seen (funcall get-prefix mu4e-headers-seen-mark)) ('replied (funcall get-prefix mu4e-headers-replied-mark))
('trashed (funcall get-prefix mu4e-headers-trashed-mark)) ('seen (funcall get-prefix mu4e-headers-seen-mark))
('attach (funcall get-prefix mu4e-headers-attach-mark)) ('trashed (funcall get-prefix mu4e-headers-trashed-mark))
('encrypted (funcall get-prefix mu4e-headers-encrypted-mark)) ('attach (funcall get-prefix mu4e-headers-attach-mark))
('signed (funcall get-prefix mu4e-headers-signed-mark)) ('encrypted (funcall get-prefix mu4e-headers-encrypted-mark))
('unread (funcall get-prefix mu4e-headers-unread-mark)))))) ('signed (funcall get-prefix mu4e-headers-signed-mark))
str)) ('unread (funcall get-prefix mu4e-headers-unread-mark)))))))
str))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;