[PATCH] emacs: Make highlight-faces for pick configurable

Daniel Schoepe daniel at schoepe.org
Sun Feb 12 06:47:18 PST 2012


---
 emacs/notmuch-pick.el |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-pick.el b/emacs/notmuch-pick.el
index 4c91d7c..2bf1ae4 100644
--- a/emacs/notmuch-pick.el
+++ b/emacs/notmuch-pick.el
@@ -42,6 +42,22 @@
   :group 'notmuch
   :type 'int)
 
+(defface notmuch-pick-match-face
+  '((((class color)
+      (background dark))
+     (:foreground "white"))
+    (((class color)
+      (background light))
+     (:foreground "black"))
+    (t (:bold t)))
+  "Face used in pick mode for matching messages."
+  :group 'notmuch)
+
+(defface notmuch-pick-no-match-face
+  '((t (:foreground "gray")))
+  "Face used in pick mode for messages not matching the query."
+  :group 'notmuch)
+
 (defvar notmuch-pick-previous-subject "")
 (make-variable-buffer-local 'notmuch-pick-previous-subject)
 
@@ -415,10 +431,9 @@ unchanged ADDRESS if parsing fails."
 	 (match (plist-get msg :match))
 	 (tags (plist-get msg :tags))
 	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject)))
-	 ;; Face should be a defcustom or something MJW
 	 (message-face (if match
-			   '(:foreground "black")
-		       '(:foreground "gray"))))
+			   'notmuch-pick-match-face
+			 'notmuch-pick-no-match-face)))
 
     (insert (propertize (concat
 			 (notmuch-pick-string-width
-- 
1.7.9



More information about the notmuch mailing list