1 Return-Path: <aaronecay@gmail.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 6AFBA4196EE
\r
6 for <notmuch@notmuchmail.org>; Sat, 6 Feb 2010 17:21:54 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.392 tagged_above=-999 required=5
\r
12 tests=[AWL=-1.207, BAYES_40=-0.185] 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 TQ5jNAt0UZSe for <notmuch@notmuchmail.org>;
\r
16 Sat, 6 Feb 2010 17:21:53 -0800 (PST)
\r
17 Received: from mail-vw0-f53.google.com (mail-vw0-f53.google.com
\r
19 by olra.theworths.org (Postfix) with ESMTP id 3275E4196ED
\r
20 for <notmuch@notmuchmail.org>; Sat, 6 Feb 2010 17:21:53 -0800 (PST)
\r
21 Received: by vws10 with SMTP id 10so1100130vws.26
\r
22 for <notmuch@notmuchmail.org>; Sat, 06 Feb 2010 17:21:52 -0800 (PST)
\r
23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
24 h=domainkey-signature:received:received:from:to:subject:date
\r
25 :message-id:x-mailer:in-reply-to:references;
\r
26 bh=A//2D9TzV7RCwnkoBYj7FrF1TsEDURe+I9bDDwZB8+8=;
\r
27 b=A6crvSsyTQnarbB9S4vPWThqz5aYBowLQr7bcXnh7bR8kbPIXAjNzYobWpib6zDHzp
\r
28 70Cna0IBvLD7XPR2LIY9xdG3AYRvLF344rz6wB1flM4sIv+JPvLQ6Gsf4Swpa4UzWEJn
\r
29 r7L18PY1oPaTrSeHAPXjD+rOEPanxzlSxkGUM=
\r
30 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
\r
31 h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;
\r
32 b=MiBxPzeT5vVm7TMA3KW8FE0BxZH3bssW71MABMrKvZlRqqkPH7MY/WdFKcZTiqnm7V
\r
33 IoBR3v24RtvaBscer9IZvrAVTXYhrMgHzMmekS4vcOdEWYpDXco7JnBGPHB8942YOA2J
\r
34 7yUicNt3s4nJI0KbGwta+yx4QjZ2SKXOf37Qc=
\r
35 Received: by 10.220.125.10 with SMTP id w10mr8546273vcr.102.1265505712543;
\r
36 Sat, 06 Feb 2010 17:21:52 -0800 (PST)
\r
37 Received: from localhost.localdomain (vpm093.wireless-resnet.upenn.edu
\r
39 by mx.google.com with ESMTPS id 39sm27869619vws.14.2010.02.06.17.21.51
\r
40 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
41 Sat, 06 Feb 2010 17:21:51 -0800 (PST)
\r
42 From: Aaron Ecay <aaronecay@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Date: Sat, 6 Feb 2010 20:21:43 -0500
\r
45 Message-Id: <1265505703-96736-1-git-send-email-aaronecay@gmail.com>
\r
46 X-Mailer: git-send-email 1.6.6
\r
47 In-Reply-To: <87r5p01pqb.fsf@servo.finestructure.net>
\r
48 References: <87r5p01pqb.fsf@servo.finestructure.net>
\r
49 Subject: [notmuch] [PATCH] Further improvements to tag-based coloring in
\r
51 X-BeenThere: notmuch@notmuchmail.org
\r
52 X-Mailman-Version: 2.1.13
\r
54 List-Id: "Use and development of the notmuch mail system."
\r
55 <notmuch.notmuchmail.org>
\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
59 List-Post: <mailto:notmuch@notmuchmail.org>
\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
63 X-List-Received-Date: Sun, 07 Feb 2010 01:21:54 -0000
\r
65 Makes the following improvements:
\r
66 - fix up doc strings
\r
67 - suppress the creation of unnecessary let-bindings
\r
68 - create overlays lazily (to avoid creating many overlays for threads
\r
69 that do not get colored)
\r
71 Signed-off-by: Aaron Ecay <aaronecay@gmail.com>
\r
73 notmuch.el | 29 ++++++++++++++---------------
\r
74 1 files changed, 14 insertions(+), 15 deletions(-)
\r
76 diff --git a/notmuch.el b/notmuch.el
\r
77 index 46159af..fff2192 100644
\r
80 @@ -1257,8 +1257,7 @@ This function advances the next thread when finished."
\r
81 '(("delete" . (:foreground "DarkGrey")))
\r
82 "Tag/face mapping for line highlighting in notmuch-search.
\r
84 -Here is an example of how to color search results based on tags.
\r
85 -(the following text would be placed in your ~/.emacs file):
\r
86 +Here is an example of how to color search results based on tags:
\r
88 (setq notmuch-search-line-faces '((\"delete\" . (:foreground \"red\"))
\r
89 (\"unread\" . (:foreground \"green\"))))
\r
90 @@ -1269,19 +1268,19 @@ matching will be applied."
\r
93 (defun notmuch-search-color-line (start end line-tag-list)
\r
94 - "Colorize lines in notmuch-search based on tags"
\r
95 - (if notmuch-search-line-faces
\r
96 - (let ((overlay (make-overlay start end))
\r
97 - (tags-faces (copy-alist notmuch-search-line-faces)))
\r
99 - (let* ((tag-face (car tags-faces))
\r
100 - (tag (car tag-face))
\r
101 - (face (cdr tag-face)))
\r
102 - (cond ((member tag line-tag-list)
\r
103 - (overlay-put overlay 'face face)
\r
104 - (setq tags-faces nil))
\r
106 - (setq tags-faces (cdr tags-faces)))))))))
\r
107 + "Colorize lines in notmuch-search based on tags.
\r
109 +Uses the tag/face mappings found in `notmuch-search-line-faces'."
\r
110 + (when notmuch-search-line-faces
\r
111 + (let ((tags-faces notmuch-search-line-faces))
\r
112 + (while tags-faces
\r
113 + (let ((tag (caar tags-faces))
\r
114 + (face (cdar tags-faces)))
\r
115 + (cond ((member tag line-tag-list)
\r
116 + (overlay-put (make-overlay start end) 'face face)
\r
117 + (setq tags-faces nil))
\r
119 + (setq tags-faces (cdr tags-faces)))))))))
\r
121 (defun notmuch-search-process-filter (proc string)
\r
122 "Process and filter the output of \"notmuch search\""
\r