1 Return-Path: <markwalters1009@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 E12CF431FD0
\r
6 for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 12:21:49 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id VqBBJHf8af6t for <notmuch@notmuchmail.org>;
\r
18 Sat, 14 Apr 2012 12:21:47 -0700 (PDT)
\r
19 Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com
\r
20 [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 3C040431FC2
\r
23 for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 12:21:43 -0700 (PDT)
\r
24 Received: by wibhn6 with SMTP id hn6so3284596wib.2
\r
25 for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 12:21:41 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
28 bh=tFt6E5PF4Ik2i9JM3XCnxHqCRerCNv0s73mCKpUn8yk=;
\r
29 b=SRxkeFzAMX7OVScMG4pO2iRHrMujWVoZo5iT8+x8OvkFtykavIRpLBdQDNuLIxvub7
\r
30 0JEL7v5s915bgdFUvKeTMfgpHt0EsPYQgq3dRa6iWyaTHpw916MW0n5yyh5294oWV0uV
\r
31 E1e6FxJCaUobXu5AJCqNnpoU4cwftl7d5vWBBnOmz+ELSZROUE4vigxfSpkEBpSbI5jB
\r
32 4nivmGeiQVHMIzcMHdI6rl6hpGxjMbGq0p5hnsQR6TadGhkgAI2OPLpgQ1qe08YrLyMK
\r
33 wNmfhaGci1qX3znnRMSPkzMADrNB2JD5F3ufMs2zWu/v/YqMH7ZSuoLp+Bxls/f9GJrG
\r
35 Received: by 10.216.131.30 with SMTP id l30mr3425417wei.111.1334431301852;
\r
36 Sat, 14 Apr 2012 12:21:41 -0700 (PDT)
\r
37 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.
\r
38 [94.192.233.223]) by mx.google.com with ESMTPS id
\r
39 fz9sm6623197wib.3.2012.04.14.12.21.40 (version=TLSv1/SSLv3 cipher=OTHER);
\r
40 Sat, 14 Apr 2012 12:21:41 -0700 (PDT)
\r
41 From: Mark Walters <markwalters1009@gmail.com>
\r
42 To: notmuch@notmuchmail.org
\r
43 Subject: [PATCH 2/3] emacs: Add `notmuch-show-line-faces' and apply it.
\r
44 Date: Sat, 14 Apr 2012 20:21:40 +0100
\r
45 Message-Id: <1334431301-27303-3-git-send-email-markwalters1009@gmail.com>
\r
46 X-Mailer: git-send-email 1.7.9.1
\r
47 In-Reply-To: <1334431301-27303-1-git-send-email-markwalters1009@gmail.com>
\r
48 References: <1334431301-27303-1-git-send-email-markwalters1009@gmail.com>
\r
49 X-BeenThere: notmuch@notmuchmail.org
\r
50 X-Mailman-Version: 2.1.13
\r
52 List-Id: "Use and development of the notmuch mail system."
\r
53 <notmuch.notmuchmail.org>
\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
57 List-Post: <mailto:notmuch@notmuchmail.org>
\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
60 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
61 X-List-Received-Date: Sat, 14 Apr 2012 19:21:50 -0000
\r
63 Similar to `notmuch-search-line-faces', `notmuch-show-line-faces'
\r
64 allows the header line in `notmuch-show-mode' buffers to be coloured
\r
65 according to the tags of the message. This is just a rebased version of
\r
66 the emacs/notmuch-show.el of David Edmondson's patch
\r
67 id:"1325006003-27152-1-git-send-email-dme@dme.org"
\r
69 emacs/notmuch-show.el | 33 +++++++++++++++++++++++++++++----
\r
70 1 files changed, 29 insertions(+), 4 deletions(-)
\r
72 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
73 index 30b26d1..3dbb25f 100644
\r
74 --- a/emacs/notmuch-show.el
\r
75 +++ b/emacs/notmuch-show.el
\r
76 @@ -94,6 +94,24 @@ any given message."
\r
77 :group 'notmuch-show
\r
78 :group 'notmuch-hooks)
\r
80 +(defcustom notmuch-show-line-faces nil
\r
81 + "Tag to face mapping for header line highlighting in `notmuch-show-mode'.
\r
83 +Here is an example of how to color search results based on tags.
\r
84 + (the following text would be placed in your ~/.emacs file):
\r
86 + (setq notmuch-search-line-faces '((\"delete\" . (:foreground \"red\"
\r
87 + :background \"blue\"))
\r
88 + (\"unread\" . (:foreground \"green\"))))
\r
90 +The attributes defined for matching tags are merged, with later
\r
91 +attributes overriding earlier. A message having both \"delete\"
\r
92 +and \"unread\" tags with the above settings would have a green
\r
93 +foreground and blue background."
\r
94 + :type '(alist :key-type (string) :value-type (custom-face-edit))
\r
95 + :group 'notmuch-show
\r
96 + :group 'notmuch-faces)
\r
98 ;; Mostly useful for debugging.
\r
99 (defcustom notmuch-show-all-multipart/alternative-parts t
\r
100 "Should all parts of multipart/alternative parts be shown?"
\r
101 @@ -412,7 +430,8 @@ unchanged ADDRESS if parsing fails."
\r
102 (defun notmuch-show-insert-headerline (headers date tags depth)
\r
103 "Insert a notmuch style headerline based on HEADERS for a
\r
104 message at DEPTH in the current thread."
\r
105 - (let ((start (point)))
\r
106 + (let ((start (point))
\r
108 (insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width depth))
\r
109 (notmuch-show-clean-address (plist-get headers :From))
\r
111 @@ -421,7 +440,9 @@ message at DEPTH in the current thread."
\r
112 (propertize (mapconcat 'identity tags " ")
\r
113 'face 'notmuch-tag-face)
\r
115 - (overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face)))
\r
116 + (setq overlay (make-overlay start (point)))
\r
117 + (overlay-put overlay 'face 'notmuch-message-summary-face)
\r
118 + (overlay-put overlay 'priority 2)))
\r
120 (defun notmuch-show-insert-header (header header-value)
\r
121 "Insert a single header."
\r
122 @@ -853,7 +874,8 @@ current buffer, if possible."
\r
123 body-start body-end
\r
124 (headers-invis-spec (notmuch-show-make-symbol "header"))
\r
125 (message-invis-spec (notmuch-show-make-symbol "message"))
\r
126 - (bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
\r
127 + (bare-subject (notmuch-show-strip-re (plist-get headers :Subject)))
\r
128 + (tags (plist-get msg :tags)))
\r
130 ;; Set `buffer-invisibility-spec' to `nil' (a list), otherwise
\r
131 ;; removing items from `buffer-invisibility-spec' (which is what
\r
132 @@ -878,10 +900,13 @@ current buffer, if possible."
\r
133 (plist-get msg :date_relative)
\r
135 (plist-get headers :Date))
\r
136 - (plist-get msg :tags) depth)
\r
139 (setq content-start (point-marker))
\r
141 + ;; Colour the header line according to the tags of the message.
\r
142 + (notmuch-color-line message-start content-start tags notmuch-show-line-faces)
\r
144 (plist-put msg :headers-invis-spec headers-invis-spec)
\r
145 (plist-put msg :message-invis-spec message-invis-spec)
\r