1 Return-Path: <dme@dme.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 8F77D4196F0
\r
6 for <notmuch@notmuchmail.org>; Thu, 29 Apr 2010 00:32:17 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5
\r
12 tests=[BAYES_00=-1.9] autolearn=ham
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id lEZUe0re9lZA for <notmuch@notmuchmail.org>;
\r
16 Thu, 29 Apr 2010 00:32:16 -0700 (PDT)
\r
17 Received: from mail-ww0-f53.google.com (mail-ww0-f53.google.com
\r
18 [74.125.82.53]) by olra.theworths.org (Postfix) with ESMTP id 2D082431FC1 for
\r
19 <notmuch@notmuchmail.org>; Thu, 29 Apr 2010 00:32:16 -0700 (PDT)
\r
20 Received: by wwe15 with SMTP id 15so508808wwe.26
\r
21 for <notmuch@notmuchmail.org>; Thu, 29 Apr 2010 00:32:15 -0700 (PDT)
\r
22 Received: by 10.216.157.73 with SMTP id n51mr1824103wek.159.1272526333652;
\r
23 Thu, 29 Apr 2010 00:32:13 -0700 (PDT)
\r
24 Received: from ut.hh.sledj.net (gmp-ea-fw-1b.sun.com [192.18.8.1])
\r
25 by mx.google.com with ESMTPS id z3sm5037021wbs.22.2010.04.29.00.32.11
\r
26 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
27 Thu, 29 Apr 2010 00:32:12 -0700 (PDT)
\r
28 Received: by ut.hh.sledj.net (Postfix, from userid 1000)
\r
29 id C9F2659411F; Thu, 29 Apr 2010 08:32:32 +0100 (BST)
\r
30 From: David Edmondson <dme@dme.org>
\r
31 To: notmuch@notmuchmail.org
\r
32 Subject: [PATCH] emacs: Allow control over faces for search mode columns.
\r
33 Date: Thu, 29 Apr 2010 08:32:31 +0100
\r
34 Message-Id: <1272526351-26770-1-git-send-email-dme@dme.org>
\r
35 X-Mailer: git-send-email 1.7.0
\r
36 X-BeenThere: notmuch@notmuchmail.org
\r
37 X-Mailman-Version: 2.1.13
\r
39 List-Id: "Use and development of the notmuch mail system."
\r
40 <notmuch.notmuchmail.org>
\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
42 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
44 List-Post: <mailto:notmuch@notmuchmail.org>
\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
48 X-List-Received-Date: Thu, 29 Apr 2010 07:32:17 -0000
\r
50 Add face declarations for the date, count, matching author and subject
\r
51 columns in search mode and apply those faces when building the search
\r
55 This is intended to support 'fruit salad' mode:
\r
56 http://dme.org/images/2010-04-29-081213_1590x1197_scrot.png
\r
58 emacs/notmuch.el | 59 +++++++++++++++++++++++++++++++++++++++--------------
\r
59 1 files changed, 43 insertions(+), 16 deletions(-)
\r
61 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
62 index d36a92d..7c9c028 100644
\r
63 --- a/emacs/notmuch.el
\r
64 +++ b/emacs/notmuch.el
\r
65 @@ -285,27 +285,48 @@ For a mouse binding, return nil."
\r
66 "Face for the single-line message summary in notmuch-show-mode."
\r
69 -(defface notmuch-tag-face
\r
70 +(defface notmuch-search-date
\r
71 + '((t :inherit default))
\r
72 + "Face used in search mode for dates."
\r
75 +(defface notmuch-search-count
\r
76 + '((t :inherit default))
\r
77 + "Face used in search mode for the count matching the query."
\r
80 +(defface notmuch-search-subject
\r
81 + '((t :inherit default))
\r
82 + "Face used in search mode for subjects."
\r
85 +(defface notmuch-search-matching-authors
\r
86 + '((t :inherit default))
\r
87 + "Face used in search mode for authors matching the query."
\r
90 +(defface notmuch-search-non-matching-authors
\r
93 - (:foreground "OliveDrab1"))
\r
94 + (:foreground "grey30"))
\r
97 - (:foreground "navy blue" :bold t))
\r
98 + (:foreground "grey60"))
\r
101 - "Notmuch search mode face used to highligh tags."
\r
103 + "Face used in search mode for authors not matching the query."
\r
106 -(defface notmuch-search-non-matching-authors
\r
107 +(defface notmuch-tag-face
\r
110 - (:foreground "grey30"))
\r
111 + (:foreground "OliveDrab1"))
\r
113 (background light))
\r
114 - (:foreground "grey60"))
\r
116 - "Face used in search mode for authors not matching the query."
\r
117 + (:foreground "navy blue" :bold t))
\r
120 + "Face used in search mode face for tags."
\r
124 @@ -599,21 +620,27 @@ matching will be applied."
\r
125 ;; `notmuch-search-process-filter'.
\r
127 (if (string-match "\\(.*\\)|\\(..*\\)" truncated-string)
\r
128 - (concat (match-string 1 truncated-string) ","
\r
129 + (concat (propertize (concat (match-string 1 truncated-string) ",")
\r
130 + 'face 'notmuch-search-matching-authors)
\r
131 (propertize (match-string 2 truncated-string)
\r
132 'face 'notmuch-search-non-matching-authors))
\r
133 - truncated-string)))))
\r
134 + (propertize truncated-string 'face 'notmuch-search-matching-authors))))))
\r
136 (defun notmuch-search-insert-field (field date count authors subject tags)
\r
138 ((string-equal field "date")
\r
139 - (insert (format (cdr (assoc field notmuch-search-result-format)) date)))
\r
140 + (insert (propertize (format (cdr (assoc field notmuch-search-result-format)) date)
\r
141 + 'face 'notmuch-search-date)))
\r
142 ((string-equal field "count")
\r
143 - (insert (format (cdr (assoc field notmuch-search-result-format)) count)))
\r
144 + (insert (propertize (format (cdr (assoc field notmuch-search-result-format)) count)
\r
145 + 'face 'notmuch-search-count)))
\r
146 + ((string-equal field "subject")
\r
147 + (insert (propertize (format (cdr (assoc field notmuch-search-result-format)) subject)
\r
148 + 'face 'notmuch-search-subject)))
\r
150 ((string-equal field "authors")
\r
151 (notmuch-search-insert-authors (cdr (assoc field notmuch-search-result-format)) authors))
\r
152 - ((string-equal field "subject")
\r
153 - (insert (format (cdr (assoc field notmuch-search-result-format)) subject)))
\r
155 ((string-equal field "tags")
\r
156 (insert (concat "(" (propertize tags 'font-lock-face 'notmuch-tag-face) ")")))))
\r