[PATCH 4/4] Update NEWS for user.other_name
[notmuch-archives.git] / 65 / b43b49133228eaa5b0a17b45c848e7bb692d69
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 EE5E6431FD5\r
6         for <notmuch@notmuchmail.org>; Sat,  5 May 2012 06:39:48 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.201\r
10 X-Spam-Level: \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 jlDrU+XvWMd4 for <notmuch@notmuchmail.org>;\r
18         Sat,  5 May 2012 06:39:46 -0700 (PDT)\r
19 Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com\r
20         [209.85.212.173]) (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 CEBF8431FC9\r
23         for <notmuch@notmuchmail.org>; Sat,  5 May 2012 06:39:42 -0700 (PDT)\r
24 Received: by mail-wi0-f173.google.com with SMTP id hr7so1498669wib.2\r
25         for <notmuch@notmuchmail.org>; Sat, 05 May 2012 06:39:42 -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=eTrMf2YDfMZtzWu1CzWLU1VdCsDJwwkBwJ2Oyaqr28g=;\r
29         b=IpUbk7UIkGXnAGCnDyj0QPbyUXfpOVqjZwHxyuPNzAmVRZ/8Su8NjM38bX7xZIEZ3a\r
30         pOTZoMyIcyg+nZTAeWopMouJjYQnEyxhFtnJ5wg8AltFrLNB8Um69/zPOafAYMQaCU+w\r
31         IWTcmAh/hnVr5zIloMZQaD7n0jOm3z5KoO4q/RsiraReINJwX6+KlmZXiUS5oulR1C4H\r
32         4wcymNUAI/wut6Fqc36sUH3s3DbrCCUJR7OZ2O4YC+7C7pDuO8t66undrNMAkIUSGYA7\r
33         Vzuhcsi6h4tqnm4z7b176WdQggMgIP6iyza/0PoDlCdG8BmJ2ER4dPspOAaxA8lw0x0r\r
34         a72Q==\r
35 Received: by 10.180.77.4 with SMTP id o4mr21353989wiw.17.1336225182580;\r
36         Sat, 05 May 2012 06:39:42 -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  6sm5808799wiz.1.2012.05.05.06.39.41    (version=TLSv1/SSLv3 cipher=OTHER);     Sat,\r
40  05 May 2012 06:39:41 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [Patch v3 2/4] emacs: Add `notmuch-show-line-faces' and apply it.\r
44 Date: Sat,  5 May 2012 14:39:45 +0100\r
45 Message-Id: <1336225187-8772-3-git-send-email-markwalters1009@gmail.com>\r
46 X-Mailer: git-send-email 1.7.9.1\r
47 In-Reply-To: <1336225187-8772-1-git-send-email-markwalters1009@gmail.com>\r
48 References: <1336225187-8772-1-git-send-email-markwalters1009@gmail.com>\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.13\r
51 Precedence: list\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, 05 May 2012 13:39:49 -0000\r
62 \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
68 ---\r
69  emacs/notmuch-show.el |   33 +++++++++++++++++++++++++++++----\r
70  1 files changed, 29 insertions(+), 4 deletions(-)\r
71 \r
72 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
73 index 37f0ebb..e62f0a0 100644\r
74 --- a/emacs/notmuch-show.el\r
75 +++ b/emacs/notmuch-show.el\r
76 @@ -93,6 +93,24 @@ any given message."\r
77    :group 'notmuch-show\r
78    :group 'notmuch-hooks)\r
79  \r
80 +(defcustom notmuch-show-line-faces nil\r
81 +  "Tag to face mapping for header line highlighting in `notmuch-show-mode'.\r
82 +\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
85 +\r
86 + (setq notmuch-show-line-faces '((\"deleted\" . (:foreground \"red\"\r
87 +                                                 :background \"blue\"))\r
88 +                                   (\"unread\" . (:foreground \"green\"))))\r
89 +\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
97 +\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 @@ -411,7 +429,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
107 +       overlay)\r
108      (insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width depth))\r
109             (notmuch-show-clean-address (plist-get headers :From))\r
110             " ("\r
111 @@ -420,7 +439,9 @@ message at DEPTH in the current thread."\r
112             (propertize (mapconcat 'identity tags " ")\r
113                         'face 'notmuch-tag-face)\r
114             ")\n")\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
119  \r
120  (defun notmuch-show-insert-header (header header-value)\r
121    "Insert a single header."\r
122 @@ -852,7 +873,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
129  \r
130      ;; Set `buffer-invisibility-spec' to `nil' (a list), otherwise\r
131      ;; removing items from `buffer-invisibility-spec' (which is what\r
132 @@ -877,10 +899,13 @@ current buffer, if possible."\r
133                                             (plist-get msg :date_relative)\r
134                                           nil)\r
135                                         (plist-get headers :Date))\r
136 -                                   (plist-get msg :tags) depth)\r
137 +                                   tags depth)\r
138  \r
139      (setq content-start (point-marker))\r
140  \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
143 +\r
144      (plist-put msg :headers-invis-spec headers-invis-spec)\r
145      (plist-put msg :message-invis-spec message-invis-spec)\r
146  \r
147 -- \r
148 1.7.9.1\r
149 \r