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 66668431FBC
\r
6 for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 07:27:33 -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 zFpS4pQ7VFdB for <notmuch@notmuchmail.org>;
\r
11 Fri, 20 Nov 2009 07:27:32 -0800 (PST)
\r
12 Received: from e28smtp02.in.ibm.com (e28smtp02.in.ibm.com [122.248.162.2])
\r
13 by olra.theworths.org (Postfix) with ESMTP id 21FCE431FAE
\r
14 for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 07:27:31 -0800 (PST)
\r
15 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58])
\r
16 by e28smtp02.in.ibm.com (8.14.3/8.13.1) with ESMTP id nAKFRSSG031145
\r
17 for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 20:57:28 +0530
\r
18 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63])
\r
19 by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id
\r
21 for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 20:57:28 +0530
\r
22 Received: from d28av01.in.ibm.com (loopback [127.0.0.1])
\r
23 by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id
\r
25 for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 20:57:27 +0530
\r
26 Received: from localhost.localdomain ([9.124.222.167])
\r
27 by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id
\r
28 nAKFRQKF013066; Fri, 20 Nov 2009 20:57:26 +0530
\r
29 From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
\r
30 To: notmuch@notmuchmail.org
\r
31 Date: Fri, 20 Nov 2009 20:57:24 +0530
\r
32 Message-Id: <1258730844-8711-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
\r
33 X-Mailer: git-send-email 1.6.5.2.74.g610f9
\r
34 Subject: [notmuch] [PATCH] notmuch.el: Add face support to search and show
\r
36 X-BeenThere: notmuch@notmuchmail.org
\r
37 X-Mailman-Version: 2.1.12
\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: Fri, 20 Nov 2009 15:27:33 -0000
\r
50 This add two faces, notmuch-show-subject-face and
\r
51 notmuch-tag-unread-face. The first face is used to show the subject
\r
52 line in the notmuch-show-mode and the second one the unread tag in
\r
53 the notmuch-search-mode.
\r
55 The changes are done looking at message.el in emacs source
\r
57 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
\r
59 notmuch.el | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
\r
60 1 files changed, 50 insertions(+), 5 deletions(-)
\r
62 diff --git a/notmuch.el b/notmuch.el
\r
63 index 4b2936a..71e9dea 100644
\r
66 @@ -603,9 +603,37 @@ which this thread was originally shown."
\r
67 (force-window-update)
\r
70 +(defun notmuch-font-lock-matcher (regexp)
\r
73 + (let ((start (point)))
\r
76 + (goto-char (point-min))
\r
77 + (setq limit (min limit (point-max)))
\r
78 + (goto-char start))
\r
79 + (and (< start limit)
\r
80 + (re-search-forward ,regexp limit t))))))
\r
81 + (if (featurep 'bytecomp)
\r
82 + (byte-compile form)
\r
85 +(defface notmuch-show-subject-face
\r
86 + '((((class color) (background light)) (:foreground "yellow" :bold t))
\r
87 + (((class color) (background dark)) (:foreground "yellow" :bold t)))
\r
88 + "Notmuch show mode face used to highligh subject line."
\r
91 +(defvar notmuch-show-font-lock-keywords
\r
92 + (let ((content ""))
\r
93 + `((,(notmuch-font-lock-matcher
\r
94 + (concat "\\(Subject:.*$\\)" content))
\r
95 + (1 'notmuch-show-subject-face nil t))))
\r
96 + "Additonal expression to hightlight in notmuch-search-mode")
\r
99 -(defun notmuch-show-mode ()
\r
100 - "Major mode for viewing a thread with notmuch.
\r
101 +(define-derived-mode notmuch-show-mode text-mode "notmuch-show"
\r
102 +"Major mode for viewing a thread with notmuch.
\r
104 This buffer contains the results of the \"notmuch show\" command
\r
105 for displaying a single thread of email from your email archives.
\r
106 @@ -643,7 +671,9 @@ view, (remove the \"inbox\" tag from each), with
\r
107 (use-local-map notmuch-show-mode-map)
\r
108 (setq major-mode 'notmuch-show-mode
\r
109 mode-name "notmuch-show")
\r
110 - (setq buffer-read-only t))
\r
111 + (setq buffer-read-only t)
\r
112 + (set (make-local-variable 'font-lock-defaults)
\r
113 + '(notmuch-show-font-lock-keywords t)))
\r
117 @@ -769,8 +799,21 @@ thread from that buffer can be show when done with this one)."
\r
118 (end-of-buffer arg)
\r
121 +(defface notmuch-tag-unread-face
\r
122 + '((((class color) (background light)) (:foreground "goldenrod" :bold t))
\r
123 + (((class color) (background dark)) (:foreground "goldenrod" :bold t)))
\r
124 + "Notmuch search mode face used to highligh inbox tags."
\r
127 +(defvar notmuch-search-font-lock-keywords
\r
128 + (let ((content ""))
\r
129 + `((,(notmuch-font-lock-matcher
\r
130 + (concat "\\(unread\\)" content))
\r
131 + (1 'notmuch-tag-unread-face nil t))))
\r
132 + "Additonal expression to hightlight in notmuch-search-mode")
\r
135 -(defun notmuch-search-mode ()
\r
136 +(define-derived-mode notmuch-search-mode text-mode "notmuch-search"
\r
137 "Major mode for searching mail with notmuch.
\r
139 This buffer contains the results of a \"notmuch search\" of your
\r
140 @@ -799,7 +842,9 @@ global search.
\r
141 (setq truncate-lines t)
\r
142 (setq major-mode 'notmuch-search-mode
\r
143 mode-name "notmuch-search")
\r
144 - (setq buffer-read-only t))
\r
145 + (setq buffer-read-only t)
\r
146 + (set (make-local-variable 'font-lock-defaults)
\r
147 + '(notmuch-search-font-lock-keywords t)))
\r
149 (defun notmuch-search-find-thread-id ()
\r