Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 22 / f5f6fe815442792f8ffdf0426a0abf5b5e2ebf
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 C8768431FC9\r
6         for <notmuch@notmuchmail.org>; Sat,  5 May 2012 06:39:49 -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 eENW9UCqLd8z for <notmuch@notmuchmail.org>;\r
18         Sat,  5 May 2012 06:39: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 45A58431FD0\r
23         for <notmuch@notmuchmail.org>; Sat,  5 May 2012 06:39:46 -0700 (PDT)\r
24 Received: by wibhn6 with SMTP id hn6so1781616wib.2\r
25         for <notmuch@notmuchmail.org>; Sat, 05 May 2012 06:39:45 -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=uPap+PNqBubb4q9RTD1EZOyBGKttS0QrCtPmVuLo9iY=;\r
29         b=nWJ7renOMlK+/py3gdN4OofYgJlHSxmhbfu+r/dfym1SY/MvFBH48vqFeJ74NK0BNj\r
30         J4NlTiJlu4oeRKJwuSDZG2ryuZPMK+M3de7nvNLKx5w/sefHb5NosiwijjE7b35j/sKR\r
31         mJ1ZRvML/KKw+GRIjqFcjPrKIKjle7L+iTmY+jMQzcP2CFiPo459iA3gk7gov519D1rG\r
32         oymYQlTT5y5D49yx3CBW5mzMobou/qN9Pak5Ig+K6Cpry1sQmaxPeYbKZr5QjShaRLZT\r
33         tnveVpskZQzgLe1qN3I06rLR5abU2G6rEs+xj9F2lGT9MRAaF8RyAVbg9Rg8+565JeYE\r
34         hcCQ==\r
35 Received: by 10.180.105.198 with SMTP id go6mr21196327wib.19.1336225184931;\r
36         Sat, 05 May 2012 06:39:44 -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  ff9sm5804953wib.2.2012.05.05.06.39.43  (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Sat, 05 May 2012 06:39:44 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [Patch v3 3/4] emacs: move notmuch-search-line-faces to "tag:" style.\r
44 Date: Sat,  5 May 2012 14:39:46 +0100\r
45 Message-Id: <1336225187-8772-4-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:50 -0000\r
62 \r
63 notmuch-search-line-faces currently has pairs of the form ("TAG"\r
64 . FACE). This changes it so that the pairs need to be of the form\r
65 ("tag:tag" . FACE). This makes it consistent with the same change to\r
66 notmuch-show-line-faces introduced in the next patch\r
67 where we allow colouring based on flags (match\r
68 and excluded) as well as tags. However, it will break people's\r
69 existing colouring lines.\r
70 \r
71 It also makes it easier for the user to make the colouring rule for\r
72 search and show the same.\r
73 ---\r
74  emacs/notmuch.el |   17 ++++++++++++-----\r
75  1 files changed, 12 insertions(+), 5 deletions(-)\r
76 \r
77 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
78 index d5f40e2..40f0cbe 100644\r
79 --- a/emacs/notmuch.el\r
80 +++ b/emacs/notmuch.el\r
81 @@ -591,16 +591,16 @@ This function advances the next thread when finished."\r
82                   (goto-char (point-min))\r
83                   (forward-line (1- notmuch-search-target-line))))))))\r
84  \r
85 -(defcustom notmuch-search-line-faces '(("unread" :weight bold)\r
86 -                                      ("flagged" :foreground "blue"))\r
87 +(defcustom notmuch-search-line-faces '(("tag:unread" :weight bold)\r
88 +                                      ("tag:flagged" :foreground "blue"))\r
89    "Tag/face mapping for line highlighting in notmuch-search.\r
90  \r
91  Here is an example of how to color search results based on tags.\r
92   (the following text would be placed in your ~/.emacs file):\r
93  \r
94 - (setq notmuch-search-line-faces '((\"deleted\" . (:foreground \"red\"\r
95 + (setq notmuch-search-line-faces '((\"tag:deleted\" . (:foreground \"red\"\r
96                                                   :background \"blue\"))\r
97 -                                   (\"unread\" . (:foreground \"green\"))))\r
98 +                                   (\"tag:unread\" . (:foreground \"green\"))))\r
99  \r
100  The attributes defined for matching tags are merged, with later\r
101  attributes overriding earlier. A message having both \"deleted\"\r
102 @@ -612,7 +612,14 @@ foreground and blue background."\r
103  \r
104  (defun notmuch-search-color-line (start end line-tag-list)\r
105    "Colorize lines in `notmuch-show' based on tags."\r
106 -  (notmuch-color-line start end line-tag-list notmuch-search-line-faces))\r
107 +  ;; This is a little ugly (we do not match on flags in search-mode)\r
108 +  ;; but is done to keep the syntax consistent in\r
109 +  ;; notmuch-search-line-faces and notmuch-show-line-faces.\r
110 +  (let (tags-and-flags)\r
111 +    (mapc (lambda (tag)\r
112 +           (setq tags-and-flags (cons (concat "tag:" tag) tags-and-flags)))\r
113 +         line-tag-list)\r
114 +  (notmuch-color-line start end tags-and-flags notmuch-search-line-faces)))\r
115  \r
116  (defun notmuch-search-author-propertize (authors)\r
117    "Split `authors' into matching and non-matching authors and\r
118 -- \r
119 1.7.9.1\r
120 \r