[PATCH] emacs: notmuch-search: fix faces
authorMichal Nazarewicz <mpn@google.com>
Thu, 23 Aug 2012 12:59:21 +0000 (14:59 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:12 +0000 (09:49 -0800)
67/9dc0b97fbcbb7b0a4d0f2468447440111938e1 [new file with mode: 0644]

diff --git a/67/9dc0b97fbcbb7b0a4d0f2468447440111938e1 b/67/9dc0b97fbcbb7b0a4d0f2468447440111938e1
new file mode 100644 (file)
index 0000000..1c5d430
--- /dev/null
@@ -0,0 +1,148 @@
+Return-Path: <mpn@google.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 075F1431FBF\r
+       for <notmuch@notmuchmail.org>; Thu, 23 Aug 2012 05:59:33 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.8\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.8 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id ue5EX36mbbRD for <notmuch@notmuchmail.org>;\r
+       Thu, 23 Aug 2012 05:59:32 -0700 (PDT)\r
+Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 212D9431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 23 Aug 2012 05:59:31 -0700 (PDT)\r
+Received: by bkwj4 with SMTP id j4so295739bkw.26\r
+       for <notmuch@notmuchmail.org>; Thu, 23 Aug 2012 05:59:30 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\r
+ s=20120113;   h=from:to:subject:date:message-id:x-mailer;\r
+       bh=rdPODBsr+WMasicDr4zWZkarC04wPP7H9WSR9eT0tkg=;\r
+       b=blrrFOU6QKEHfFCPzMV6+I7eRi92b8PCS6DoYoOod1JwjVV7qh+YbP+hHD7h78mTKn\r
+       Dw+J6Oc1OMJvLeogGhlNq9wplwWzwUEaoN1U8aAE1DJlb4SR4CdjKt6w9/FUuOlCdswD\r
+       +/0JHEWKMlurpbsdi2255Eg4vYTxNdKu/1VGFwO1sBinB9Y/5lf4OyYI0ah2j3sHBAVf\r
+       4N1L12XEgNfFdvCELgdxxdondsxiruRF0yRiN4jitvlIDKiB7lpaDZJVy4kwS0tGD8MO\r
+       fJ72uU+DMXOYX0BQzOZ9IqP67FhV9CvDzXQrUcXe9UYIzgSTWHRgmgiSqSxBrkcQJALQ    hn7w==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=from:to:subject:date:message-id:x-mailer:x-gm-message-state;\r
+       bh=rdPODBsr+WMasicDr4zWZkarC04wPP7H9WSR9eT0tkg=;\r
+       b=dUzYB9dFcEVSh58v0D0KbGF+yydnjI9993s/Iillbae1SCQ+P4ls4vsAjiOQZHAfRi\r
+       0ygXLKuc+ZZupAXWPqVG7tkivfP5159TI4OEET37irieFkuzg22ZVDK+CrUYnjvp7L0l\r
+       PX5H67GGrmBzk0+RMNl51rsmbUMaVmaZvUWAGBjjgipkdYtAj9bSIzWL4xg9zx4NLEao\r
+       rtUfVXNmO5TO4LSFazfIgCh0RUWB5z9XBtcysAG36e3FnYTjtGmYmwBP2N+sh5fH2mvD\r
+       JN+39Ot34AHZ2v3/CqJmJpIRN/oXWbWdubQE09QbTN46h/aNJF2Gt1LJWBmvp+t7ruBB\r
+       nF9g==\r
+Received: by 10.205.137.8 with SMTP id im8mr424918bkc.135.1345726770592;\r
+       Thu, 23 Aug 2012 05:59:30 -0700 (PDT)\r
+Received: by 10.205.137.8 with SMTP id im8mr424902bkc.135.1345726770269;\r
+       Thu, 23 Aug 2012 05:59:30 -0700 (PDT)\r
+Received: from mpn-glaptop.corp.google.com\r
+       (dhcp-172-16-75-166.zrh.corp.google.com [172.16.75.166])\r
+       by mx.google.com with ESMTPS id 14sm4590735bkw.15.2012.08.23.05.59.28\r
+       (version=SSLv3 cipher=OTHER); Thu, 23 Aug 2012 05:59:29 -0700 (PDT)\r
+From: Michal Nazarewicz <mpn@google.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: notmuch-search: fix faces\r
+Date: Thu, 23 Aug 2012 14:59:21 +0200\r
+Message-Id:\r
+ <83882f4c8de5317e0184dc091a197b2341e5f015.1345725028.git.mina86@mina86.com>\r
+X-Mailer: git-send-email 1.7.7.3\r
+X-Gm-Message-State: ALoCoQkDKhR1v4nMB3sCJujrsDe0vOmFr+SB0HlZd9lulPiIyfkXa1tKbTAyUruEHsgJNSx4obXEKlKehvVwiKRM2z+3IaXTauVNFdBNGcv++kO2tlnDe3/Co57qs2PcQHShaCBbRZiU2Cgr2KuOD66Iv8FIdARYr9dlPblLtsC7pZP9YbaCuOf3kZSZihERNJncWR2dqLaxSEnvCDrdMgZAYMqdkdCmxw==\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 23 Aug 2012 12:59:33 -0000\r
+\r
+From: Michal Nazarewicz <mina86@mina86.com>\r
+\r
+For some reason the faces do not get applied when 'face property is\r
+used, but they work correctly with 'font-lock-face property.  This\r
+commit changes notmuch-search to use the latter.\r
+---\r
+ emacs/notmuch.el |   23 +++++++++++++----------\r
+ 1 files changed, 13 insertions(+), 10 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index 7b61e9b..44cbe28 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -692,10 +692,10 @@ propertize appropriately. If no boundary between authors and\r
+ non-authors is found, assume that all of the authors match."\r
+   (if (string-match "\\(.*\\)|\\(.*\\)" authors)\r
+       (concat (propertize (concat (match-string 1 authors) ",")\r
+-                        'face 'notmuch-search-matching-authors)\r
++                        'font-lock-face 'notmuch-search-matching-authors)\r
+             (propertize (match-string 2 authors)\r
+-                        'face 'notmuch-search-non-matching-authors))\r
+-    (propertize authors 'face 'notmuch-search-matching-authors)))\r
++                        'font-lock-face 'notmuch-search-non-matching-authors))\r
++    (propertize authors 'font-lock-face 'notmuch-search-matching-authors)))\r
+ \r
+ (defun notmuch-search-insert-authors (format-string authors)\r
+   ;; Save the match data to avoid interfering with\r
+@@ -741,11 +741,14 @@ non-authors is found, assume that all of the authors match."\r
+         (setq visible-string (notmuch-search-author-propertize visible-string)\r
+               ;; The invisible string must contain only non-matching\r
+               ;; authors, as the visible-string contains both.\r
+-              invisible-string (propertize invisible-string\r
+-                                           'face 'notmuch-search-non-matching-authors))\r
++              invisible-string\r
++              (propertize invisible-string\r
++                          'font-lock-face\r
++                          'notmuch-search-non-matching-authors))\r
+       ;; The visible string contains only matching authors.\r
+       (setq visible-string (propertize visible-string\r
+-                                       'face 'notmuch-search-matching-authors)\r
++                                       'font-lock-face\r
++                                       'notmuch-search-matching-authors)\r
+             ;; The invisible string may contain both matching and\r
+             ;; non-matching authors.\r
+             invisible-string (notmuch-search-author-propertize invisible-string)))\r
+@@ -770,15 +773,15 @@ non-authors is found, assume that all of the authors match."\r
+   (cond\r
+    ((string-equal field "date")\r
+     (insert (propertize (format format-string (plist-get result :date_relative))\r
+-                      'face 'notmuch-search-date)))\r
++                      'font-lock-face 'notmuch-search-date)))\r
+    ((string-equal field "count")\r
+     (insert (propertize (format format-string\r
+                               (format "[%s/%s]" (plist-get result :matched)\r
+                                       (plist-get result :total)))\r
+-                      'face 'notmuch-search-count)))\r
++                      'font-lock-face 'notmuch-search-count)))\r
+    ((string-equal field "subject")\r
+     (insert (propertize (format format-string (plist-get result :subject))\r
+-                      'face 'notmuch-search-subject)))\r
++                      'font-lock-face 'notmuch-search-subject)))\r
+ \r
+    ((string-equal field "authors")\r
+     (notmuch-search-insert-authors format-string (plist-get result :authors)))\r
+@@ -786,7 +789,7 @@ non-authors is found, assume that all of the authors match."\r
+    ((string-equal field "tags")\r
+     (let ((tags-str (mapconcat 'identity (plist-get result :tags) " ")))\r
+       (insert (propertize (format format-string tags-str)\r
+-                        'face 'notmuch-tag-face))))))\r
++                        'font-lock-face 'notmuch-tag-face))))))\r
+ \r
+ (defun notmuch-search-show-result (result &optional pos)\r
+   "Insert RESULT at POS or the end of the buffer if POS is null."\r
+-- \r
+1.7.7.3\r
+\r