1 Return-Path: <jani@nikula.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 6537C431FB6
\r
6 for <notmuch@notmuchmail.org>; Sat, 5 May 2012 04:45:30 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\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 vOJ9Q3AUsSea for <notmuch@notmuchmail.org>;
\r
16 Sat, 5 May 2012 04:45:26 -0700 (PDT)
\r
17 Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com
\r
18 [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id A0C9C431FAE
\r
21 for <notmuch@notmuchmail.org>; Sat, 5 May 2012 04:45:25 -0700 (PDT)
\r
22 Received: by lbbgk8 with SMTP id gk8so2839017lbb.26
\r
23 for <notmuch@notmuchmail.org>; Sat, 05 May 2012 04:45:22 -0700 (PDT)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=google.com; s=20120113;
\r
26 h=from:to:subject:in-reply-to:references:user-agent:date:message-id
\r
27 :mime-version:content-type:x-gm-message-state;
\r
28 bh=rrgnsvX9gTtAeqH1CASjLgJLqWVwBSmf0oJHSRaywIc=;
\r
29 b=ibEfIM43ycp2DkoX4tuDh6TwTV2FG6tca8K60MniFOsubx4EL5I0cLwnCuRU7DtiGV
\r
30 bqS22svsGLKul6We07pRT4W1CKzxIo3UmC41NCgczpTYFxzgB32+OcOC10FcJj3vrxGh
\r
31 lflz8cDgLzBDuLIL1VHhFzGaTCXV5w8pusGN+DLGUYthAYSCJRpd5WVGW2hnLCz7J4vY
\r
32 6HstPV7Il9YlEmFCBsQ5Y27oToSlJ44V6BbG8FjZW3pQ3Ld2FWXqPLq6apRxzHkdySsM
\r
33 S/etf6gpM07JFA1sc5Q8/EjO8I9EgL4Jkg66sNq4yK+jemArE1wqWi86t57vSueKf2lv
\r
35 Received: by 10.152.114.106 with SMTP id jf10mr8849397lab.16.1336218322454;
\r
36 Sat, 05 May 2012 04:45:22 -0700 (PDT)
\r
37 Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi.
\r
39 by mx.google.com with ESMTPS id j6sm14856244lbl.0.2012.05.05.04.45.19
\r
40 (version=SSLv3 cipher=OTHER); Sat, 05 May 2012 04:45:20 -0700 (PDT)
\r
41 From: Jani Nikula <jani@nikula.org>
\r
42 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
\r
43 Subject: Re: [Patch v2 2/3] emacs: Add `notmuch-show-line-faces' and apply it.
\r
44 In-Reply-To: <1335739697-8501-3-git-send-email-markwalters1009@gmail.com>
\r
45 References: <1335739697-8501-1-git-send-email-markwalters1009@gmail.com>
\r
46 <1335739697-8501-3-git-send-email-markwalters1009@gmail.com>
\r
47 User-Agent: Notmuch/0.12+169~g45438b0 (http://notmuchmail.org) Emacs/23.3.1
\r
49 Date: Sat, 05 May 2012 14:45:17 +0300
\r
50 Message-ID: <87bom2j1gy.fsf@nikula.org>
\r
52 Content-Type: text/plain; charset=us-ascii
\r
54 ALoCoQn47k/AHPvksT0n6SxFsA8T9R+AmEWdlk4QO4+etoexOgRKESVkfpbDZYyWdW8QpivPCZBL
\r
55 X-BeenThere: notmuch@notmuchmail.org
\r
56 X-Mailman-Version: 2.1.13
\r
58 List-Id: "Use and development of the notmuch mail system."
\r
59 <notmuch.notmuchmail.org>
\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
63 List-Post: <mailto:notmuch@notmuchmail.org>
\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
67 X-List-Received-Date: Sat, 05 May 2012 11:45:31 -0000
\r
69 On Mon, 30 Apr 2012, Mark Walters <markwalters1009@gmail.com> wrote:
\r
70 > Similar to `notmuch-search-line-faces', `notmuch-show-line-faces'
\r
71 > allows the header line in `notmuch-show-mode' buffers to be coloured
\r
72 > according to the tags of the message. This is just a rebased version of
\r
73 > the emacs/notmuch-show.el of David Edmondson's patch
\r
74 > id:"1325006003-27152-1-git-send-email-dme@dme.org"
\r
76 > emacs/notmuch-show.el | 33 +++++++++++++++++++++++++++++----
\r
77 > 1 files changed, 29 insertions(+), 4 deletions(-)
\r
79 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
80 > index 37f0ebb..bb7db6e 100644
\r
81 > --- a/emacs/notmuch-show.el
\r
82 > +++ b/emacs/notmuch-show.el
\r
83 > @@ -93,6 +93,24 @@ any given message."
\r
84 > :group 'notmuch-show
\r
85 > :group 'notmuch-hooks)
\r
87 > +(defcustom notmuch-show-line-faces nil
\r
88 > + "Tag to face mapping for header line highlighting in `notmuch-show-mode'.
\r
90 > +Here is an example of how to color search results based on tags.
\r
91 > + (the following text would be placed in your ~/.emacs file):
\r
93 > + (setq notmuch-search-line-faces '((\"delete\" . (:foreground \"red\"
\r
95 That should be notmuch-show-line-faces.
\r
99 > + :background \"blue\"))
\r
100 > + (\"unread\" . (:foreground \"green\"))))
\r
102 > +The attributes defined for matching tags are merged, with later
\r
103 > +attributes overriding earlier. A message having both \"delete\"
\r
104 > +and \"unread\" tags with the above settings would have a green
\r
105 > +foreground and blue background."
\r
106 > + :type '(alist :key-type (string) :value-type (custom-face-edit))
\r
107 > + :group 'notmuch-show
\r
108 > + :group 'notmuch-faces)
\r
110 > ;; Mostly useful for debugging.
\r
111 > (defcustom notmuch-show-all-multipart/alternative-parts t
\r
112 > "Should all parts of multipart/alternative parts be shown?"
\r
113 > @@ -411,7 +429,8 @@ unchanged ADDRESS if parsing fails."
\r
114 > (defun notmuch-show-insert-headerline (headers date tags depth)
\r
115 > "Insert a notmuch style headerline based on HEADERS for a
\r
116 > message at DEPTH in the current thread."
\r
117 > - (let ((start (point)))
\r
118 > + (let ((start (point))
\r
120 > (insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width depth))
\r
121 > (notmuch-show-clean-address (plist-get headers :From))
\r
123 > @@ -420,7 +439,9 @@ message at DEPTH in the current thread."
\r
124 > (propertize (mapconcat 'identity tags " ")
\r
125 > 'face 'notmuch-tag-face)
\r
127 > - (overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face)))
\r
128 > + (setq overlay (make-overlay start (point)))
\r
129 > + (overlay-put overlay 'face 'notmuch-message-summary-face)
\r
130 > + (overlay-put overlay 'priority 2)))
\r
132 > (defun notmuch-show-insert-header (header header-value)
\r
133 > "Insert a single header."
\r
134 > @@ -852,7 +873,8 @@ current buffer, if possible."
\r
135 > body-start body-end
\r
136 > (headers-invis-spec (notmuch-show-make-symbol "header"))
\r
137 > (message-invis-spec (notmuch-show-make-symbol "message"))
\r
138 > - (bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
\r
139 > + (bare-subject (notmuch-show-strip-re (plist-get headers :Subject)))
\r
140 > + (tags (plist-get msg :tags)))
\r
142 > ;; Set `buffer-invisibility-spec' to `nil' (a list), otherwise
\r
143 > ;; removing items from `buffer-invisibility-spec' (which is what
\r
144 > @@ -877,10 +899,13 @@ current buffer, if possible."
\r
145 > (plist-get msg :date_relative)
\r
147 > (plist-get headers :Date))
\r
148 > - (plist-get msg :tags) depth)
\r
151 > (setq content-start (point-marker))
\r
153 > + ;; Colour the header line according to the tags of the message.
\r
154 > + (notmuch-color-line message-start content-start tags notmuch-show-line-faces)
\r
156 > (plist-put msg :headers-invis-spec headers-invis-spec)
\r
157 > (plist-put msg :message-invis-spec message-invis-spec)
\r
162 > _______________________________________________
\r
163 > notmuch mailing list
\r
164 > notmuch@notmuchmail.org
\r
165 > http://notmuchmail.org/mailman/listinfo/notmuch
\r