Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 22 / 463fd92cd9b14d348df53c95413040c3619724
1 Return-Path: <pieter@praet.org>\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 1E830431FD0\r
6         for <notmuch@notmuchmail.org>; Mon,  4 Jul 2011 02:47:30 -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.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id os3sdpnMuM8p for <notmuch@notmuchmail.org>;\r
16         Mon,  4 Jul 2011 02:47:28 -0700 (PDT)\r
17 Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
18         [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 309BA431FB6\r
21         for <notmuch@notmuchmail.org>; Mon,  4 Jul 2011 02:47:28 -0700 (PDT)\r
22 Received: by wyh22 with SMTP id 22so3829167wyh.26\r
23         for <notmuch@notmuchmail.org>; Mon, 04 Jul 2011 02:47:27 -0700 (PDT)\r
24 Received: by 10.227.164.79 with SMTP id d15mr5344373wby.62.1309772846875;\r
25         Mon, 04 Jul 2011 02:47:26 -0700 (PDT)\r
26 Received: from localhost ([109.131.160.67])\r
27         by mx.google.com with ESMTPS id fu18sm4338991wbb.27.2011.07.04.02.47.25\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Mon, 04 Jul 2011 02:47:26 -0700 (PDT)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>, notmuch@notmuchmail.org\r
32 Subject: Re: [PATCH v2] emacs: add insisible space after the search widget\r
33         field in notmuch-hello\r
34 In-Reply-To: <87r56676qs.fsf@gmail.com>\r
35 References: <id:1309762025-1172-1-git-send-email-dmitry.kurochkin@gmail.com>\r
36         <1309768024-14584-1-git-send-email-dmitry.kurochkin@gmail.com>\r
37         <8762nifmrq.fsf@praet.org> <87r56676qs.fsf@gmail.com>\r
38 User-Agent: Notmuch/0.5-326-ga5de9f3 (http://notmuchmail.org) Emacs/23.1.50.1\r
39         (x86_64-pc-linux-gnu)\r
40 Date: Mon, 04 Jul 2011 11:47:24 +0200\r
41 Message-ID: <87wrfys7gz.fsf@praet.org>\r
42 MIME-Version: 1.0\r
43 Content-Type: text/plain; charset=us-ascii\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Mon, 04 Jul 2011 09:47:30 -0000\r
57 \r
58 On Mon, 04 Jul 2011 13:08:43 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
59 > On Mon, 04 Jul 2011 10:55:21 +0200, Pieter Praet <pieter@praet.org> wrote:\r
60 > > On Mon,  4 Jul 2011 12:27:04 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
61 > > > It is very convenient when C-e (bound to `widget-end-of-line') ignores\r
62 > > > trailing spaces inside the search widget.  But it only does so if a\r
63 > > > widget is not followed by a newline (that is why it works in the saved\r
64 > > > search widgets).  The patch just adds an insisible space after the\r
65 > > > search widget to get the desirable behavior of `widget-end-of-line'.\r
66 > > > \r
67 > > > Previous behavior of C-e:\r
68 > > > \r
69 > > >   Search: [text                _]\r
70 > > > \r
71 > > > Now:\r
72 > > > \r
73 > > >   Search: [text_                ]\r
74 > > > \r
75 > > > The extra space is also added to expected results of emacs tests.\r
76 > > > ---\r
77 > > > \r
78 > > > Amended version with a better commit message.  Stolen from a similar\r
79 > > > patch by Kan-Ru Chen [1] as suggested by Pieter Praet :)\r
80 > > \r
81 > > Muhahaaa!\r
82 > > \r
83 > > > Regards,\r
84 > > >   Dmitry\r
85 > > > \r
86 > > > [1] id:"1280195325-9066-2-git-send-email-kanru@kanru.info"\r
87 > > > \r
88 > > >  emacs/notmuch-hello.el                             |    4 ++++\r
89 > > >  test/emacs.expected-output/notmuch-hello           |    2 +-\r
90 > > >  .../notmuch-hello-no-saved-searches                |    2 +-\r
91 > > >  .../emacs.expected-output/notmuch-hello-with-empty |    2 +-\r
92 > > >  4 files changed, 7 insertions(+), 3 deletions(-)\r
93 > > > \r
94 > > > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
95 > > > index 65fde75..1a76c30 100644\r
96 > > > --- a/emacs/notmuch-hello.el\r
97 > > > +++ b/emacs/notmuch-hello.el\r
98 > > > @@ -462,6 +462,10 @@ Complete list of currently available key bindings:\r
99 > > >                                  (length "Search: ")))\r
100 > > >                  :action (lambda (widget &rest ignore)\r
101 > > >                            (notmuch-hello-search (widget-value widget))))\r
102 > > > + ;; add an invisible space to make `widget-end-of-line' ignore\r
103 > > > + ;; trailine spaces in the search widget field\r
104 > > > + (widget-insert " ")\r
105 > > > + (put-text-property (1- (point)) (point) 'invisible t)\r
106 > > >   (widget-insert "\n")\r
107 > > >  \r
108 > > >   (when notmuch-hello-recent-searches\r
109 > > > diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello\r
110 > > > index 64b7e42..48143bd 100644\r
111 > > > --- a/test/emacs.expected-output/notmuch-hello\r
112 > > > +++ b/test/emacs.expected-output/notmuch-hello\r
113 > > > @@ -4,7 +4,7 @@ Saved searches: [edit]\r
114 > > >  \r
115 > > >     50 inbox           50 unread    \r
116 > > >  \r
117 > > > -Search:                                                                     \r
118 > > > +Search:                                                                      \r
119 > > >  \r
120 > > >  [Show all tags]\r
121 > > >  \r
122 > > > diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
123 > > > index 7f8206a..7c09e40 100644\r
124 > > > --- a/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
125 > > > +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
126 > > > @@ -1,6 +1,6 @@\r
127 > > >     Welcome to notmuch. You have 50 messages.\r
128 > > >  \r
129 > > > -Search:                                                                     \r
130 > > > +Search:                                                                      \r
131 > > >  \r
132 > > >  [Show all tags]\r
133 > > >  \r
134 > > > diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty\r
135 > > > index a9ed630..2a267c9 100644\r
136 > > > --- a/test/emacs.expected-output/notmuch-hello-with-empty\r
137 > > > +++ b/test/emacs.expected-output/notmuch-hello-with-empty\r
138 > > > @@ -4,7 +4,7 @@ Saved searches: [edit]\r
139 > > >  \r
140 > > >     50 inbox           50 unread           0 empty     \r
141 > > >  \r
142 > > > -Search:                                                                     \r
143 > > > +Search:                                                                      \r
144 > > >  \r
145 > > >  [Show all tags]\r
146 > > >  \r
147 > > > -- \r
148 > > > 1.7.5.4\r
149 > > > \r
150 > > > _______________________________________________\r
151 > > > notmuch mailing list\r
152 > > > notmuch@notmuchmail.org\r
153 > > > http://notmuchmail.org/mailman/listinfo/notmuch\r
154 > > \r
155 > > Signed-off-by: Pieter Praet <pieter@praet.org>\r
156 > > \r
157 > > \r
158 > > Would this be the right place to promote two of your previous patches [1,2] ?\r
159 > > \r
160 > > They serve as ears when using eye protection against `show-trailing-whitespace'.\r
161 > > \r
162\r
163 > I am glad somebody uses it except for me :)  I use them exactly for the\r
164 > same reason.\r
165\r
166 > They are not ready for mainline.  Two issues:\r
167\r
168 > * Poor commit message should be improved to make Carl happy.\r
169 \r
170 Rather skimpy indeed (as in non-existent) but I think the mere act of\r
171 inserting "\n" at the right point in their titles would provide a fairly\r
172 descriptive commit msg.\r
173 \r
174 > * I have wrote them long ago, and I am not sure it is a proper\r
175 >   implementation.  I need to double check that before asking Carl to\r
176 >   push it.  Or somebody else with a better elisp knowledge should review\r
177 >   and approve it.\r
178\r
179 > I have been delaying this for some time.  Since now I know somebody\r
180 > actually uses it, I may get to it sooner rather than later.  But no\r
181 > promises.\r
182 \r
183 No promises? I demand a full refund!\r
184 \r
185 > BTW I am not really sure that hooks are the best solution for turning\r
186 > off `show-trailing-whitespace'.  Perhaps there is a better way?  Would\r
187 > appreciate comments.  (Though, hooks would be useful anyway.)\r
188 \r
189 I (humbly) assert that hooks cure both the sniffles and cancer.\r
190 \r
191 Why install a sink, when one could instead provide the means to install\r
192 an entire kitchen? People *will* reciprocate with patches for mainline,\r
193 as previous threads have thoroughly proven. Even more so, I'd argue,\r
194 since experimentation is facilitated.\r
195 \r
196 > Regards,\r
197 >   Dmitry\r
198\r
199 > > \r
200 > > Peace\r
201 > > \r
202 > > -- \r
203 > > Pieter\r
204 > > \r
205 > > [1] id:"1278000507-22290-5-git-send-email-dmitry.kurochkin@gmail.com"\r
206 > > [2] id:"1278000507-22290-6-git-send-email-dmitry.kurochkin@gmail.com"\r
207 \r
208 \r
209 Peace\r
210 \r
211 -- \r
212 Pieter\r