unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michal Nazarewicz <mpn@google.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] emacs: notmuch-search: fix faces
Date: Thu, 23 Aug 2012 14:59:21 +0200	[thread overview]
Message-ID: <83882f4c8de5317e0184dc091a197b2341e5f015.1345725028.git.mina86@mina86.com> (raw)

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

             reply	other threads:[~2012-08-23 12:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23 12:59 Michal Nazarewicz [this message]
2012-08-27 20:40 ` [PATCH] emacs: notmuch-search: fix faces Jameson Graef Rollins
2012-08-27 23:11   ` Michal Nazarewicz
2012-08-28  0:22     ` Austin Clements
2012-08-28  0:51       ` Michal Nazarewicz
2012-08-28  2:19         ` Austin Clements
2012-08-28 12:58           ` Michal Nazarewicz
2012-08-30  8:18             ` Tomi Ollila
2012-09-03 12:18               ` Michal Nazarewicz
2012-09-05 23:43 ` Michal Nazarewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83882f4c8de5317e0184dc091a197b2341e5f015.1345725028.git.mina86@mina86.com \
    --to=mpn@google.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).