Re: [PATCH] emacs: add default value to notmuch-search-line-faces

Subject: Re: [PATCH] emacs: add default value to notmuch-search-line-faces

Date: Sat, 28 Jan 2012 11:18:23 +0000

To: David Edmondson

Cc: Notmuch Mail

From: Mark Walters


I wondered whether the general view is that this following trivial
extension to David's notmuch-show-line-faces patch is too gross/hacky to
live? It passes a fake tag of "flag:match" to notmuch-color-line so that
the same customisation as for colouring lines based on tags can also
colour based on match. I find it useful when using the collapsed view
for example.

Best wishes

Mark


diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index c448ab2..00c1a2f 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -837,11 +837,14 @@ current buffer, if possible."
 	 content-start content-end
 	 headers-start headers-end
 	 body-start body-end
+	 tags-and-flags
 	 (headers-invis-spec (notmuch-show-make-symbol "header"))
 	 (message-invis-spec (notmuch-show-make-symbol "message"))
 	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject)))
 	 (tags (plist-get msg :tags)))
 
+    (if (plist-get msg :match)
+	(setq tags-and-flags (append tags '("flag:match"))))
     ;; Set `buffer-invisibility-spec' to `nil' (a list), otherwise
     ;; removing items from `buffer-invisibility-spec' (which is what
     ;; `notmuch-show-headers-visible' and
@@ -870,7 +873,7 @@ current buffer, if possible."
     (setq content-start (point-marker))
 
     ;; Colour the header line according to the tags of the message.
-    (notmuch-color-line message-start content-start tags notmuch-show-line-faces)
+    (notmuch-color-line message-start content-start tags-and-flags notmuch-show-line-faces)
 
     (plist-put msg :headers-invis-spec headers-invis-spec)
     (plist-put msg :message-invis-spec message-invis-spec)
-- 
1.7.2.3


Thread: