Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / ce / 1e96b67af20740ebcf866dbcc6af82224b465c
1 Return-Path: <m.walters@qmul.ac.uk>\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 58F50431FBC\r
6         for <notmuch@notmuchmail.org>; Sat, 22 Mar 2014 00:47:52 -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: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id LwvCwlMdCfhz for <notmuch@notmuchmail.org>;\r
17         Sat, 22 Mar 2014 00:47:48 -0700 (PDT)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 01D1A431FAE\r
22         for <notmuch@notmuchmail.org>; Sat, 22 Mar 2014 00:47:47 -0700 (PDT)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1WRGeb-00039i-Fd; Sat, 22 Mar 2014 07:47:41 +0000\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1WRGea-0004OQ-SI; Sat, 22 Mar 2014 07:47:41 +0000\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Austin Clements <amdragon@MIT.EDU>\r
33 Subject: Re: [Patch v3 4/8] emacs: tag: add customize for deleted/added tag\r
34         formats\r
35 In-Reply-To: <20140322021609.GB31187@mit.edu>\r
36 References: <1394597397-8486-1-git-send-email-markwalters1009@gmail.com>\r
37         <1394597397-8486-5-git-send-email-markwalters1009@gmail.com>\r
38         <20140322021609.GB31187@mit.edu>\r
39 User-Agent: Notmuch/0.15.2+615~g78e3a93 (http://notmuchmail.org) Emacs/23.4.1\r
40         (x86_64-pc-linux-gnu)\r
41 Date: Sat, 22 Mar 2014 07:47:39 +0000\r
42 Message-ID: <87ior6oesk.fsf@qmul.ac.uk>\r
43 MIME-Version: 1.0\r
44 Content-Type: text/plain; charset=us-ascii\r
45 X-Sender-Host-Address: 93.97.24.31\r
46 X-QM-Geographic: According to ripencc,\r
47         this message was delivered by a machine in Britain (UK) (GB).\r
48 X-QM-SPAM-Info: Sender has good ham record.  :)\r
49 X-QM-Body-MD5: 033e6cf192a41b6134c9b330e4d76b83 (of first 20000 bytes)\r
50 X-SpamAssassin-Score: 0.0\r
51 X-SpamAssassin-SpamBar: /\r
52 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
53         determine if it is\r
54         spam. We require at least 5.0 points to mark a message as spam.\r
55         This message scored 0.0 points. Summary of the scoring: \r
56         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
57         provider *      (markwalters1009[at]gmail.com)\r
58         * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
59         *      domain\r
60         *  0.0 AWL AWL: From: address is in the auto white-list\r
61 X-QM-Scan-Virus: ClamAV says the message is clean\r
62 Cc: notmuch@notmuchmail.org\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Sat, 22 Mar 2014 07:47:52 -0000\r
76 \r
77 \r
78 Hi\r
79 \r
80 Many thanks for the review.\r
81 \r
82 On Sat, 22 Mar 2014, Austin Clements <amdragon@MIT.EDU> wrote:\r
83 > Quoth Mark Walters on Mar 12 at  4:09 am:\r
84 >> Add customize options for deleted/added tag formats.  These are not\r
85 >> used yet but will be later in the series.\r
86 >> \r
87 >> We switch to using `notmuch-apply-face' rather than `propertize' in\r
88 >> the defcustom for faces so that the faces for deleted/added tags add\r
89 >> to the default face attributes for the tag.\r
90 >> \r
91 >> We special case deleting the unread tag as that tag is a strong visual\r
92 >> cue and we don't need that cue when we are just saying it used to be\r
93 >> unread. Thus, we revert to the normal tag face with strikethough for\r
94 >> deleted unread tags.\r
95 >> ---\r
96 >>  emacs/notmuch-tag.el |   37 ++++++++++++++++++++++++++++++++++++-\r
97 >>  1 files changed, 36 insertions(+), 1 deletions(-)\r
98 >> \r
99 >> diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el\r
100 >> index a4dea39..4698856 100644\r
101 >> --- a/emacs/notmuch-tag.el\r
102 >> +++ b/emacs/notmuch-tag.el\r
103 >> @@ -39,7 +39,7 @@ (define-widget 'notmuch-tag-format-type 'lazy\r
104 >>                          (string :tag "Display as")\r
105 >>                          (list :tag "Face" :extra-offset -4\r
106 >>                                (const :format "" :inline t\r
107 >> -                                     (propertize tag 'face))\r
108 >> +                                     (notmuch-apply-face tag))\r
109 >>                                (list :format "%v"\r
110 >>                                      (const :format "" quote)\r
111 >>                                      custom-face-edit))\r
112 >> @@ -89,6 +89,41 @@ (defcustom notmuch-tag-formats\r
113 >>    :group 'notmuch-show\r
114 >>    :type 'notmuch-tag-format-type)\r
115 >>  \r
116 >> +(defcustom notmuch-tag-deleted-formats\r
117 >> +  '(("unread" (notmuch-apply-face "unread"\r
118 >> +                  (if (display-supports-face-attributes-p '(:strike-through "red"))\r
119 >> +                      '(:strike-through "red")\r
120 >> +                    '(:inverse-video t))))\r
121 >> +    (".*" (notmuch-apply-face tag\r
122 >> +                  (if (display-supports-face-attributes-p '(:strike-through "red"))\r
123 >> +                      '(:strike-through "red")\r
124 >> +                    '(:inverse-video t)))))\r
125 >\r
126 > Aren't the two formatters above the same thing?  Is this somehow\r
127 > different from just having the .* formatter?  The indentation also\r
128 > seems a little odd, though that may just be the diff.\r
129 \r
130 These are not the same because these functions apply to tag which is the\r
131 partially formatted tag, not tag itself. Thus the latter applies the\r
132 above formatting to the string "unread" rather than `tag' which would be\r
133 the string unread with previous formatting applied.\r
134 \r
135 It might be nice to change the name in the function so a formatter has\r
136 access to tag and formatted-tag but that would break people's existing\r
137 formats.\r
138 \r
139 >\r
140 >> +  "Custom formats for tags when deleted.\r
141 >> +\r
142 >> +For deleted tags the formats in `notmuch-tag-formats` are applied\r
143 >> +first and then these formats are applied on top.\r
144 >> +\r
145 >> +By default this shows deleted tags with strike-through in red,\r
146 >> +unless strike-through is not available (e.g., emacs is running in\r
147 >> +a terminal) in which case it uses inverse video. To hide deleted\r
148 >> +tags completely set this to\r
149 >> +  '((\".*\" nil))\r
150 >> +\r
151 >> +See `notmuch-tag-formats' for full documentation."\r
152 >> +  :group 'notmuch-show\r
153 >> +  :type 'notmuch-tag-format-type)\r
154 >> +\r
155 >> +(defcustom notmuch-tag-added-formats\r
156 >> +  '((".*" (notmuch-apply-face tag '(:underline "green"))))\r
157 >> +  "Custom formats for tags when added.\r
158 >> +\r
159 >> +For added tags the formats in `notmuch-tag-formats` are applied\r
160 >> +first and then these formats are applied on top.\r
161 >\r
162 > Maybe add\r
163 >\r
164 > To disable special formatting of added tags, set this to ().\r
165 >\r
166 > to parallel notmuch-tag-deleted-formats?\r
167 \r
168 Yes this is a good point as it is not obvious what the correct form is\r
169 as it is different from the deleted case (here we want to apply no\r
170 further formatting to the tag so it shows as normal, there we wanted to\r
171 hide the tag)\r
172 \r
173 Best wishes\r
174 \r
175 Mark\r
176 \r
177 \r
178 >\r
179 >> +\r
180 >> +See `notmuch-tag-formats' for full documentation."\r
181 >> +  :group 'notmuch-show\r
182 >> +  :type 'notmuch-tag-format-type)\r
183 >> +\r
184 >>  (defun notmuch-tag-format-image-data (tag data)\r
185 >>    "Replace TAG with image DATA, if available.\r
186 >>  \r