Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / ff / 9f73f5bbefde9481fc08dc702ec3b4d43d6bdb
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 94F7B4041E4\r
6         for <notmuch@notmuchmail.org>; Mon,  9 Apr 2012 14:57:18 -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 V7g6D5Rx6cmO for <notmuch@notmuchmail.org>;\r
17         Mon,  9 Apr 2012 14:57:17 -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 5A1524041E1\r
22         for <notmuch@notmuchmail.org>; Mon,  9 Apr 2012 14:57:17 -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 1SHMaF-0007tm-6o; Mon, 09 Apr 2012 22:57:13 +0100\r
27 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]\r
28         helo=localhost)\r
29         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
30         (envelope-from <m.walters@qmul.ac.uk>)\r
31         id 1SHMaE-0007MH-M3; Mon, 09 Apr 2012 22:57:11 +0100\r
32 From: Mark Walters <markwalters1009@gmail.com>\r
33 To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>, notmuch@notmuchmail.org\r
34 Subject: Re: [PATCH] emacs: get rid of trailing spaces in notmuch-hello view\r
35 In-Reply-To: <1331351655-16921-1-git-send-email-dmitry.kurochkin@gmail.com>\r
36 References: <1331351655-16921-1-git-send-email-dmitry.kurochkin@gmail.com>\r
37 User-Agent: Notmuch/0.12+111~g5c30f66 (http://notmuchmail.org) Emacs/23.3.1\r
38         (x86_64-pc-linux-gnu)\r
39 Date: Mon, 09 Apr 2012 22:57:27 +0100\r
40 Message-ID: <87ty0s7em0.fsf@qmul.ac.uk>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain; charset=us-ascii\r
43 X-Sender-Host-Address: 94.192.233.223\r
44 X-QM-SPAM-Info: Sender has good ham record.  :)\r
45 X-QM-Body-MD5: da980ce2e611f18173bdc00bb5f5e2d1 (of first 20000 bytes)\r
46 X-SpamAssassin-Score: -1.8\r
47 X-SpamAssassin-SpamBar: -\r
48 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
49         determine if it is\r
50         spam. We require at least 5.0 points to mark a message as spam.\r
51         This message scored -1.8 points.\r
52         Summary of the scoring: \r
53         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
54         *      medium trust\r
55         *      [138.37.6.40 listed in list.dnswl.org]\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.5 AWL AWL: From: address is in the auto white-list\r
61 X-QM-Scan-Virus: ClamAV says the message is clean\r
62 X-BeenThere: notmuch@notmuchmail.org\r
63 X-Mailman-Version: 2.1.13\r
64 Precedence: list\r
65 List-Id: "Use and development of the notmuch mail system."\r
66         <notmuch.notmuchmail.org>\r
67 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
69 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
70 List-Post: <mailto:notmuch@notmuchmail.org>\r
71 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
72 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
73         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
74 X-List-Received-Date: Mon, 09 Apr 2012 21:57:18 -0000\r
75 \r
76 \r
77 This looks fine to me (but I am not a lisp expert).\r
78 \r
79 Mark\r
80 \r
81 On Sat, 10 Mar 2012, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
82 > This patch removes trailing spaces in notmuch-hello view.\r
83 >\r
84 > A side effect of this change is that tag/query buttons no longer\r
85 > include a space at the end.  This means that pressing RET when the\r
86 > point is at the first character after the tag/query button no longer\r
87 > works (note that this is the standard behavior for buttons).  We may\r
88 > change this behavior in the future (without adding trailing spaces\r
89 > back) if people would find this change inconvenient.\r
90 > ---\r
91 >  emacs/notmuch-hello.el                             |   30 ++++++++------------\r
92 >  test/emacs                                         |    2 +-\r
93 >  test/emacs.expected-output/notmuch-hello           |    2 +-\r
94 >  .../emacs.expected-output/notmuch-hello-long-names |    6 ++--\r
95 >  .../notmuch-hello-new-section                      |    2 +-\r
96 >  .../notmuch-hello-section-counts                   |    4 +-\r
97 >  .../notmuch-hello-section-hidden-tag               |    2 +-\r
98 >  .../notmuch-hello-section-with-empty               |    2 +-\r
99 >  .../emacs.expected-output/notmuch-hello-with-empty |    2 +-\r
100 >  9 files changed, 23 insertions(+), 29 deletions(-)\r
101 >\r
102 > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
103 > index 28f39f1..17f7edd 100644\r
104 > --- a/emacs/notmuch-hello.el\r
105 > +++ b/emacs/notmuch-hello.el\r
106 > @@ -429,7 +429,8 @@ Such a list can be computed with `notmuch-hello-query-counts'."\r
107 >    (let* ((widest (notmuch-hello-longest-label searches))\r
108 >        (tags-and-width (notmuch-hello-tags-per-line widest))\r
109 >        (tags-per-line (car tags-and-width))\r
110 > -      (widest (cdr tags-and-width))\r
111 > +      (column-width (cdr tags-and-width))\r
112 > +      (column-indent 0)\r
113 >        (count 0)\r
114 >        (reordered-list (notmuch-hello-reflect searches tags-per-line))\r
115 >        ;; Hack the display of the buttons used.\r
116 > @@ -441,32 +442,25 @@ Such a list can be computed with `notmuch-hello-query-counts'."\r
117 >      (mapc (lambda (elem)\r
118 >           ;; (not elem) indicates an empty slot in the matrix.\r
119 >           (when elem\r
120 > +           (if (> column-indent 0)\r
121 > +               (widget-insert (make-string column-indent ? )))\r
122 >             (let* ((name (first elem))\r
123 >                    (query (second elem))\r
124 > -                  (msg-count (third elem))\r
125 > -                  (formatted-name (format "%s " name)))\r
126 > +                  (msg-count (third elem)))\r
127 >               (widget-insert (format "%8s "\r
128 >                                      (notmuch-hello-nice-number msg-count)))\r
129 > -             (if (string= formatted-name notmuch-hello-target)\r
130 > +             (if (string= name notmuch-hello-target)\r
131 >                   (setq found-target-pos (point-marker)))\r
132 >               (widget-create 'push-button\r
133 >                              :notify #'notmuch-hello-widget-search\r
134 >                              :notmuch-search-terms query\r
135 > -                            formatted-name)\r
136 > -             (unless (eq (% count tags-per-line) (1- tags-per-line))\r
137 > -               ;; If this is not the last tag on the line, insert\r
138 > -               ;; enough space to consume the rest of the column.\r
139 > -               ;; Because the button for the name is `(1+ (length\r
140 > -               ;; name))' long (due to the trailing space) we can\r
141 > -               ;; just insert `(- widest (length name))' spaces - the\r
142 > -               ;; column separator is included in the button if\r
143 > -               ;; `(equal widest (length name)'.\r
144 > -               (widget-insert (make-string (max 0\r
145 > -                                                (- widest (length name)))\r
146 > -                                           ? )))))\r
147 > +                            name)\r
148 > +             (setq column-indent\r
149 > +                   (1+ (max 0 (- column-width (length name)))))))\r
150 >           (setq count (1+ count))\r
151 > -         (if (eq (% count tags-per-line) 0)\r
152 > -             (widget-insert "\n")))\r
153 > +         (when (eq (% count tags-per-line) 0)\r
154 > +           (setq column-indent 0)\r
155 > +           (widget-insert "\n")))\r
156 >         reordered-list)\r
157 >  \r
158 >      ;; If the last line was not full (and hence did not include a\r
159 > diff --git a/test/emacs b/test/emacs\r
160 > index 29a489c..42780af 100755\r
161 > --- a/test/emacs\r
162 > +++ b/test/emacs\r
163 > @@ -39,7 +39,7 @@ test_begin_subtest "Navigation of notmuch-hello to search results"\r
164 >  test_emacs '(notmuch-hello)\r
165 >           (goto-char (point-min))\r
166 >           (re-search-forward "inbox")\r
167 > -         (widget-button-press (point))\r
168 > +         (widget-button-press (1- (point)))\r
169 >           (notmuch-test-wait)\r
170 >           (test-output)'\r
171 >  test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-view-inbox\r
172 > diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello\r
173 > index 1470790..2d69891 100644\r
174 > --- a/test/emacs.expected-output/notmuch-hello\r
175 > +++ b/test/emacs.expected-output/notmuch-hello\r
176 > @@ -2,7 +2,7 @@\r
177 >  \r
178 >  Saved searches: [edit]\r
179 >  \r
180 > -       52 inbox           52 unread    \r
181 > +       52 inbox           52 unread\r
182 >  \r
183 >  Search:                                                                     .\r
184 >  \r
185 > diff --git a/test/emacs.expected-output/notmuch-hello-long-names b/test/emacs.expected-output/notmuch-hello-long-names\r
186 > index be6d2c5..486d0d9 100644\r
187 > --- a/test/emacs.expected-output/notmuch-hello-long-names\r
188 > +++ b/test/emacs.expected-output/notmuch-hello-long-names\r
189 > @@ -2,14 +2,14 @@\r
190 >  \r
191 >  Saved searches: [edit]\r
192 >  \r
193 > -       52 inbox           52 unread    \r
194 > +       52 inbox           52 unread\r
195 >  \r
196 >  Search:                                                                     .\r
197 >  \r
198 >  All tags: [hide]\r
199 >  \r
200 > -       52 a-very-long-tag       52 inbox                 52 unread \r
201 > -        4 attachment             7 signed          \r
202 > +       52 a-very-long-tag       52 inbox                 52 unread\r
203 > +        4 attachment             7 signed\r
204 >  \r
205 >        Type a search query and hit RET to view matching threads.\r
206 >               Edit saved searches with the `edit' button.\r
207 > diff --git a/test/emacs.expected-output/notmuch-hello-new-section b/test/emacs.expected-output/notmuch-hello-new-section\r
208 > index 6a339aa..67fdef2 100644\r
209 > --- a/test/emacs.expected-output/notmuch-hello-new-section\r
210 > +++ b/test/emacs.expected-output/notmuch-hello-new-section\r
211 > @@ -1,4 +1,4 @@\r
212 >  Test: [hide]\r
213 >  \r
214 > -       52 inbox \r
215 > +       52 inbox\r
216 >  \r
217 > diff --git a/test/emacs.expected-output/notmuch-hello-section-counts b/test/emacs.expected-output/notmuch-hello-section-counts\r
218 > index 9d79659..7a9827c 100644\r
219 > --- a/test/emacs.expected-output/notmuch-hello-section-counts\r
220 > +++ b/test/emacs.expected-output/notmuch-hello-section-counts\r
221 > @@ -1,5 +1,5 @@\r
222 >  Test-with-counts: [hide]\r
223 >  \r
224 > -        2 attachment             7 signed          \r
225 > -        7 inbox                  7 unread          \r
226 > +        2 attachment             7 signed\r
227 > +        7 inbox                  7 unread\r
228 >  \r
229 > diff --git a/test/emacs.expected-output/notmuch-hello-section-hidden-tag b/test/emacs.expected-output/notmuch-hello-section-hidden-tag\r
230 > index 3688e7c..809a114 100644\r
231 > --- a/test/emacs.expected-output/notmuch-hello-section-hidden-tag\r
232 > +++ b/test/emacs.expected-output/notmuch-hello-section-hidden-tag\r
233 > @@ -1,4 +1,4 @@\r
234 >  Test-with-filtered: [hide]\r
235 >  \r
236 > -        4 attachment            52 inbox                  7 signed \r
237 > +        4 attachment            52 inbox                  7 signed\r
238 >  \r
239 > diff --git a/test/emacs.expected-output/notmuch-hello-section-with-empty b/test/emacs.expected-output/notmuch-hello-section-with-empty\r
240 > index dc2568d..5c67317 100644\r
241 > --- a/test/emacs.expected-output/notmuch-hello-section-with-empty\r
242 > +++ b/test/emacs.expected-output/notmuch-hello-section-with-empty\r
243 > @@ -1,4 +1,4 @@\r
244 >  Test-with-empty: [hide]\r
245 >  \r
246 > -       52 inbox \r
247 > +       52 inbox\r
248 >  \r
249 > diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty\r
250 > index 5e53222..854e0c2 100644\r
251 > --- a/test/emacs.expected-output/notmuch-hello-with-empty\r
252 > +++ b/test/emacs.expected-output/notmuch-hello-with-empty\r
253 > @@ -2,7 +2,7 @@\r
254 >  \r
255 >  Saved searches: [edit]\r
256 >  \r
257 > -       52 inbox           52 unread           0 empty     \r
258 > +       52 inbox           52 unread           0 empty\r
259 >  \r
260 >  Search:                                                                     .\r
261 >  \r
262 > -- \r
263 > 1.7.9.1\r
264 >\r
265 > _______________________________________________\r
266 > notmuch mailing list\r
267 > notmuch@notmuchmail.org\r
268 > http://notmuchmail.org/mailman/listinfo/notmuch\r