Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 35 / 6de8d1567776cc7fddf32fd0b4a0df961bb58d
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
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \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
38 Precedence: list\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
49 \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
52 mode display.\r
53 ---\r
54 \r
55 This is intended to support 'fruit salad' mode: \r
56    http://dme.org/images/2010-04-29-081213_1590x1197_scrot.png\r
57 \r
58  emacs/notmuch.el |   59 +++++++++++++++++++++++++++++++++++++++--------------\r
59  1 files changed, 43 insertions(+), 16 deletions(-)\r
60 \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
67   :group 'notmuch)\r
68  \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
73 +  :group 'notmuch)\r
74 +\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
78 +  :group 'notmuch)\r
79 +\r
80 +(defface notmuch-search-subject\r
81 +  '((t :inherit default))\r
82 +  "Face used in search mode for subjects."\r
83 +  :group 'notmuch)\r
84 +\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
88 +  :group 'notmuch)\r
89 +\r
90 +(defface notmuch-search-non-matching-authors\r
91    '((((class color)\r
92        (background dark))\r
93 -     (:foreground "OliveDrab1"))\r
94 +     (:foreground "grey30"))\r
95      (((class color)\r
96        (background light))\r
97 -     (:foreground "navy blue" :bold t))\r
98 +     (:foreground "grey60"))\r
99      (t\r
100 -     (:bold t)))\r
101 -  "Notmuch search mode face used to highligh tags."\r
102 +     (:italic t)))\r
103 +  "Face used in search mode for authors not matching the query."\r
104    :group 'notmuch)\r
105  \r
106 -(defface notmuch-search-non-matching-authors\r
107 +(defface notmuch-tag-face\r
108    '((((class color)\r
109        (background dark))\r
110 -     (:foreground "grey30"))\r
111 +     (:foreground "OliveDrab1"))\r
112      (((class color)\r
113        (background light))\r
114 -     (:foreground "grey60"))\r
115 -    (t (:italic t)))\r
116 -  "Face used in search mode for authors not matching the query."\r
117 +     (:foreground "navy blue" :bold t))\r
118 +    (t\r
119 +     (:bold t)))\r
120 +  "Face used in search mode face for tags."\r
121    :group 'notmuch)\r
122  \r
123  ;;;###autoload\r
124 @@ -599,21 +620,27 @@ matching will be applied."\r
125             ;; `notmuch-search-process-filter'.\r
126             (save-match-data\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
135  \r
136  (defun notmuch-search-insert-field (field date count authors subject tags)\r
137    (cond\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
149 +\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
154 +\r
155     ((string-equal field "tags")\r
156      (insert (concat "(" (propertize tags 'font-lock-face 'notmuch-tag-face) ")")))))\r
157  \r
158 -- \r
159 1.7.0\r
160 \r