database error
[notmuch-archives.git] / 65 / 87d4947a17e2a57f5113b07c0c1a4629ecce45
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 3ACD4431FC2\r
6         for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 12:21:51 -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 pROiv4MNmym7 for <notmuch@notmuchmail.org>;\r
18         Sat, 14 Apr 2012 12:21:50 -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 629DF429E27\r
23         for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 12:21:45 -0700 (PDT)\r
24 Received: by wibhq7 with SMTP id hq7so6114674wib.2\r
25         for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 12:21:44 -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=bBzpGblhZzOa3AopxPFdYPMqUEo4zJv3c7k9X22Gv7U=;\r
29         b=HPRwL6u2JwWdlx7N7CDDsq98c4dPrV2MGjKt9g+IF4rZZBlv465at+Ry/PSfUy87Cz\r
30         9lud+ysfYjwUEvoxTAxmrwPknqWCOAIsGXpLaEurKP5EMbgL6ZjL77lqyXUGY4eAYUJI\r
31         rfrjtIFKt2Ze8ditUjIBUHGFER6O2tXcY52cPRAK3buI3DW2RXjxoiuZ22ytN0UCxvxl\r
32         XKQYn7uBNb58xRQM4IzOFm6bdftq0sKLojhYLz7IxYK2228TGcURJVjjtWQWw2sXdJvR\r
33         EDV9h2BceHUE8rceB5pmMj8XxcYOftZHd3mSTIYDcw3JDNi811bJtsYddIk1NUo7Kmr7\r
34         lEHg==\r
35 Received: by 10.180.92.228 with SMTP id cp4mr6048784wib.2.1334431303948;\r
36         Sat, 14 Apr 2012 12:21:43 -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  l5sm6598183wia.11.2012.04.14.12.21.42  (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Sat, 14 Apr 2012 12:21:43 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH 3/3] emacs: allow notmuch-show-line-faces to use flags for\r
44         colouring\r
45 Date: Sat, 14 Apr 2012 20:21:41 +0100\r
46 Message-Id: <1334431301-27303-4-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 In-Reply-To: <1334431301-27303-1-git-send-email-markwalters1009@gmail.com>\r
49 References: <1334431301-27303-1-git-send-email-markwalters1009@gmail.com>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Sat, 14 Apr 2012 19:21:51 -0000\r
63 \r
64 This allows header-lines `notmuch-show-mode' buffers to be coloured\r
65 based on the flags (match/excluded) of the message. It supplies the\r
66 line colouring function with a list of tags each prefixed with "tag:"\r
67 and a list of flags ("match" or "excluded") each prefixed with\r
68 "flag:".\r
69 \r
70 The match flag is obviously not equivalent to a tag; the excluded flag\r
71 looks equivalent but is subtly different: a message is not marked\r
72 excluded if that tag appeared in the query.\r
73 ---\r
74  emacs/notmuch-show.el |   21 ++++++++++++++++-----\r
75  1 files changed, 16 insertions(+), 5 deletions(-)\r
76 \r
77 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
78 index 3dbb25f..66b8ec7 100644\r
79 --- a/emacs/notmuch-show.el\r
80 +++ b/emacs/notmuch-show.el\r
81 @@ -97,14 +97,16 @@ any given message."\r
82  (defcustom notmuch-show-line-faces nil\r
83    "Tag to face mapping for header line highlighting in `notmuch-show-mode'.\r
84  \r
85 -Here is an example of how to color search results based on tags.\r
86 +Here is an example of how to color search results based on tags\r
87 +and flags (match and excluded).\r
88   (the following text would be placed in your ~/.emacs file):\r
89  \r
90 - (setq notmuch-search-line-faces '((\"delete\" . (:foreground \"red\"\r
91 + (setq notmuch-search-line-faces '((\"tag:delete\" . (:foreground \"red\"\r
92                                                   :background \"blue\"))\r
93 -                                   (\"unread\" . (:foreground \"green\"))))\r
94 +                                   (\"tag:unread\" . (:foreground \"green\"))\r
95 +                                   (\"flag:excluded\" . (:background \"grey\"))))\r
96  \r
97 -The attributes defined for matching tags are merged, with later\r
98 +The attributes defined for matching tags/flags are merged, with later\r
99  attributes overriding earlier. A message having both \"delete\"\r
100  and \"unread\" tags with the above settings would have a green\r
101  foreground and blue background."\r
102 @@ -872,11 +874,20 @@ current buffer, if possible."\r
103          content-start content-end\r
104          headers-start headers-end\r
105          body-start body-end\r
106 +        tags-and-flags\r
107          (headers-invis-spec (notmuch-show-make-symbol "header"))\r
108          (message-invis-spec (notmuch-show-make-symbol "message"))\r
109          (bare-subject (notmuch-show-strip-re (plist-get headers :Subject)))\r
110          (tags (plist-get msg :tags)))\r
111  \r
112 +    (mapc (lambda (tag)\r
113 +           (setq tags-and-flags (cons (concat "tag:" tag) tags-and-flags)))\r
114 +         tags)\r
115 +    (if (plist-get msg :match)\r
116 +       (setq tags-and-flags (cons "flag:match" tags-and-flags)))\r
117 +    (if (plist-get msg :excluded)\r
118 +       (setq tags-and-flags (cons "flag:excluded" tags-and-flags)))\r
119 +\r
120      ;; Set `buffer-invisibility-spec' to `nil' (a list), otherwise\r
121      ;; removing items from `buffer-invisibility-spec' (which is what\r
122      ;; `notmuch-show-headers-visible' and\r
123 @@ -905,7 +916,7 @@ current buffer, if possible."\r
124      (setq content-start (point-marker))\r
125  \r
126      ;; Colour the header line according to the tags of the message.\r
127 -    (notmuch-color-line message-start content-start tags notmuch-show-line-faces)\r
128 +    (notmuch-color-line message-start content-start tags-and-flags notmuch-show-line-faces)\r
129  \r
130      (plist-put msg :headers-invis-spec headers-invis-spec)\r
131      (plist-put msg :message-invis-spec message-invis-spec)\r
132 -- \r
133 1.7.9.1\r
134 \r