From b714a808a692a99c1b936be43186a40ab251aeca Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 23 Mar 2013 12:29:54 +0100 Subject: emacs: possibility to customize the rendering of tags This patch extracts the rendering of tags in notmuch-show to the notmuch-tag file. This file introduces a `notmuch-tag-formats' variable that associates each tag to a particular format. This variable can be customized thanks to the work of Austin Clements. For example, '(("unread" (propertize tag 'face '(:foreground "red"))) ("flagged" (notmuch-tag-format-image tag "star.svg"))) associates a red foreground to the "unread" tag and a star picture to the "flagged" tag. Signed-off-by: Damien Cassou --- emacs/notmuch-show.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'emacs/notmuch-show.el') diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index acaef8ef..a4d2c128 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -362,8 +362,7 @@ operation on the contents of the current buffer." (if (re-search-forward "(\\([^()]*\\))$" (line-end-position) t) (let ((inhibit-read-only t)) (replace-match (concat "(" - (propertize (mapconcat 'identity tags " ") - 'face 'notmuch-tag-face) + (notmuch-tag-format-tags tags) ")")))))) (defun notmuch-clean-address (address) @@ -441,8 +440,7 @@ message at DEPTH in the current thread." " (" date ") (" - (propertize (mapconcat 'identity tags " ") - 'face 'notmuch-tag-face) + (notmuch-tag-format-tags tags) ")\n") (overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face))) -- cgit v1.2.3