1 Return-Path: <aneesh.kumar@linux.vnet.ibm.com>
\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 37A5D431FC0
\r
6 for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 00:42:32 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 Received: from olra.theworths.org ([127.0.0.1])
\r
9 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
10 with ESMTP id xVply4urItTh for <notmuch@notmuchmail.org>;
\r
11 Fri, 27 Nov 2009 00:42:31 -0800 (PST)
\r
12 Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143])
\r
13 by olra.theworths.org (Postfix) with ESMTP id 196DA431FAE
\r
14 for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 00:42:30 -0800 (PST)
\r
15 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247])
\r
16 by e23smtp01.au.ibm.com (8.14.3/8.13.1) with ESMTP id nAR8ep80026404
\r
17 for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 19:40:51 +1100
\r
18 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96])
\r
19 by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id
\r
21 for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 19:38:55 +1100
\r
22 Received: from d23av01.au.ibm.com (loopback [127.0.0.1])
\r
23 by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id
\r
25 for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 19:42:28 +1100
\r
26 Received: from localhost.localdomain (N20wks267599wss.in.ibm.com
\r
28 by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id
\r
29 nAR8gRva004813; Fri, 27 Nov 2009 19:42:27 +1100
\r
30 From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
\r
31 To: notmuch@notmuchmail.org
\r
32 Date: Fri, 27 Nov 2009 14:12:11 +0530
\r
34 <1259311332-14557-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
\r
35 X-Mailer: git-send-email 1.6.5.2.74.g610f9
\r
37 <1259125080-18708-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
\r
39 <1259125080-18708-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
\r
40 Subject: [notmuch] [PATCH -v5] notmuch.el: Add face support to search mode
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.12
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Fri, 27 Nov 2009 08:42:32 -0000
\r
55 This patch use notmuch-tag-face showing tags in the notmuch-search-mode.
\r
57 We can selectively highlight each tag by setting notmuch-tag-face-alist as below
\r
59 (defface notmuch-tag-unread-face
\r
60 '((((class color)) (:foreground "goldenrod")))
\r
61 "Notmuch search mode face used to highligh tags.")
\r
63 (defface notmuch-tag-inbox-face
\r
64 '((((class color)) (:foreground "red")))
\r
65 "Notmuch search mode face used to highligh tags.")
\r
67 (setq notmuch-tag-face-alist '(("unread" . 'notmuch-tag-unread-face)
\r
68 ("inbox" . 'notmuch-tag-inbox-face)))
\r
71 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
\r
73 notmuch.el | 23 ++++++++++++++++++++++-
\r
74 1 files changed, 22 insertions(+), 1 deletions(-)
\r
76 diff --git a/notmuch.el b/notmuch.el
\r
77 index 551048a..4dc5a06 100644
\r
80 @@ -835,6 +835,16 @@ thread from that buffer can be show when done with this one)."
\r
81 (goto-char (point-max))
\r
84 +(defface notmuch-tag-face
\r
85 + '((((class color)) (:foreground "red")))
\r
86 + "Notmuch search mode face used to highligh tags."
\r
89 +(defvar notmuch-tag-face-alist nil
\r
90 + "List containing the tag list that need to be highlighed")
\r
92 +(defvar notmuch-search-font-lock-keywords nil)
\r
95 (defun notmuch-search-mode ()
\r
96 "Major mode for searching mail with notmuch.
\r
97 @@ -865,7 +875,18 @@ global search.
\r
98 (setq truncate-lines t)
\r
99 (setq major-mode 'notmuch-search-mode
\r
100 mode-name "notmuch-search")
\r
101 - (setq buffer-read-only t))
\r
102 + (setq buffer-read-only t)
\r
103 + (if (not notmuch-tag-face-alist)
\r
104 + (add-to-list 'notmuch-search-font-lock-keywords (list
\r
105 + "\\(([^)]*)$\\)" '(1 'notmuch-tag-face)))
\r
107 + (setq notmuch-search-tags (mapcar 'car notmuch-tag-face-alist))
\r
108 + (loop for notmuch-search-tag in notmuch-search-tags
\r
109 + do (add-to-list 'notmuch-search-font-lock-keywords (list
\r
110 + (concat "\\(" notmuch-search-tag "\\)")
\r
111 + `(1 ,(cdr (assoc notmuch-search-tag notmuch-tag-face-alist))))))))
\r
112 + (set (make-local-variable 'font-lock-defaults)
\r
113 + '(notmuch-search-font-lock-keywords t)))
\r
115 (defun notmuch-search-find-thread-id ()
\r
116 "Return the thread for the current thread"
\r