[PATCH] emacs: notmuch-search: fix faces

Subject: [PATCH] emacs: notmuch-search: fix faces

Date: Thu, 23 Aug 2012 14:59:21 +0200

To: notmuch@notmuchmail.org

Cc:

From: Michal Nazarewicz


From: Michal Nazarewicz <mina86@mina86.com>

For some reason the faces do not get applied when 'face property is
used, but they work correctly with 'font-lock-face property.  This
commit changes notmuch-search to use the latter.
---
 emacs/notmuch.el |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 7b61e9b..44cbe28 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -692,10 +692,10 @@ propertize appropriately. If no boundary between authors and
 non-authors is found, assume that all of the authors match."
   (if (string-match "\\(.*\\)|\\(.*\\)" authors)
       (concat (propertize (concat (match-string 1 authors) ",")
-			  'face 'notmuch-search-matching-authors)
+			  'font-lock-face 'notmuch-search-matching-authors)
 	      (propertize (match-string 2 authors)
-			  'face 'notmuch-search-non-matching-authors))
-    (propertize authors 'face 'notmuch-search-matching-authors)))
+			  'font-lock-face 'notmuch-search-non-matching-authors))
+    (propertize authors 'font-lock-face 'notmuch-search-matching-authors)))
 
 (defun notmuch-search-insert-authors (format-string authors)
   ;; Save the match data to avoid interfering with
@@ -741,11 +741,14 @@ non-authors is found, assume that all of the authors match."
 	  (setq visible-string (notmuch-search-author-propertize visible-string)
 		;; The invisible string must contain only non-matching
 		;; authors, as the visible-string contains both.
-		invisible-string (propertize invisible-string
-					     'face 'notmuch-search-non-matching-authors))
+		invisible-string
+		(propertize invisible-string
+			    'font-lock-face
+			    'notmuch-search-non-matching-authors))
 	;; The visible string contains only matching authors.
 	(setq visible-string (propertize visible-string
-					 'face 'notmuch-search-matching-authors)
+					 'font-lock-face
+					 'notmuch-search-matching-authors)
 	      ;; The invisible string may contain both matching and
 	      ;; non-matching authors.
 	      invisible-string (notmuch-search-author-propertize invisible-string)))
@@ -770,15 +773,15 @@ non-authors is found, assume that all of the authors match."
   (cond
    ((string-equal field "date")
     (insert (propertize (format format-string (plist-get result :date_relative))
-			'face 'notmuch-search-date)))
+			'font-lock-face 'notmuch-search-date)))
    ((string-equal field "count")
     (insert (propertize (format format-string
 				(format "[%s/%s]" (plist-get result :matched)
 					(plist-get result :total)))
-			'face 'notmuch-search-count)))
+			'font-lock-face 'notmuch-search-count)))
    ((string-equal field "subject")
     (insert (propertize (format format-string (plist-get result :subject))
-			'face 'notmuch-search-subject)))
+			'font-lock-face 'notmuch-search-subject)))
 
    ((string-equal field "authors")
     (notmuch-search-insert-authors format-string (plist-get result :authors)))
@@ -786,7 +789,7 @@ non-authors is found, assume that all of the authors match."
    ((string-equal field "tags")
     (let ((tags-str (mapconcat 'identity (plist-get result :tags) " ")))
       (insert (propertize (format format-string tags-str)
-			  'face 'notmuch-tag-face))))))
+			  'font-lock-face 'notmuch-tag-face))))))
 
 (defun notmuch-search-show-result (result &optional pos)
   "Insert RESULT at POS or the end of the buffer if POS is null."
-- 
1.7.7.3


Thread: