Re: elisp + company completion patches, v7
[notmuch-archives.git] / 3d / 80f4e84ec949e86506a79d5d77259cc0a88688
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 C6D3D431FB6\r
6         for <notmuch@notmuchmail.org>; Mon,  4 Jul 2011 00:24:24 -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 hY42VROqeig7 for <notmuch@notmuchmail.org>;\r
16         Mon,  4 Jul 2011 00:24:23 -0700 (PDT)\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
18  [74.125.82.45])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  5E1EA431FD0    for <notmuch@notmuchmail.org>; Mon,  4 Jul 2011 00:24:23 -0700\r
21  (PDT)\r
22 Received: by wwj40 with SMTP id 40so3874189wwj.2\r
23         for <notmuch@notmuchmail.org>; Mon, 04 Jul 2011 00:24:22 -0700 (PDT)\r
24 Received: by 10.216.78.198 with SMTP id g48mr5492296wee.45.1309764260571;\r
25         Mon, 04 Jul 2011 00:24:20 -0700 (PDT)\r
26 Received: from localhost ([109.131.160.67])\r
27         by mx.google.com with ESMTPS id v60sm389632wer.34.2011.07.04.00.24.18\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Mon, 04 Jul 2011 00:24:19 -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] emacs: add insisible space after the search widget field\r
33         in notmuch-hello\r
34 In-Reply-To: <1309762025-1172-1-git-send-email-dmitry.kurochkin@gmail.com>\r
35 References: <1309762025-1172-1-git-send-email-dmitry.kurochkin@gmail.com>\r
36 User-Agent: Notmuch/0.5-326-ga5de9f3 (http://notmuchmail.org) Emacs/23.1.50.1\r
37         (x86_64-pc-linux-gnu)\r
38 Date: Mon, 04 Jul 2011 09:24:17 +0200\r
39 Message-ID: <87zkkuv78e.fsf@praet.org>\r
40 MIME-Version: 1.0\r
41 Content-Type: text/plain; charset=us-ascii\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Mon, 04 Jul 2011 07:24:24 -0000\r
55 \r
56 On Mon,  4 Jul 2011 10:47:05 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
57 > It is very convenient when C-e (bound to `widget-end-of-line') ignores\r
58 > trailing spaces inside the search widget.  But it only does so if a\r
59 > widget is not followed by a newline (that is why it works in the saved\r
60 > search widgets).  The patch just adds an insisible space after the\r
61 > search widget to get the desirable behavior of `widget-end-of-line'.\r
62 > The extra space is also added to expected results of emacs tests.\r
63 > ---\r
64 >  emacs/notmuch-hello.el                             |    4 ++++\r
65 >  test/emacs.expected-output/notmuch-hello           |    2 +-\r
66 >  .../notmuch-hello-no-saved-searches                |    2 +-\r
67 >  .../emacs.expected-output/notmuch-hello-with-empty |    2 +-\r
68 >  4 files changed, 7 insertions(+), 3 deletions(-)\r
69\r
70 > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
71 > index 65fde75..1a76c30 100644\r
72 > --- a/emacs/notmuch-hello.el\r
73 > +++ b/emacs/notmuch-hello.el\r
74 > @@ -462,6 +462,10 @@ Complete list of currently available key bindings:\r
75 >                                      (length "Search: ")))\r
76 >                      :action (lambda (widget &rest ignore)\r
77 >                                (notmuch-hello-search (widget-value widget))))\r
78 > +     ;; add an invisible space to make `widget-end-of-line' ignore\r
79 > +     ;; trailine spaces in the search widget field\r
80 > +     (widget-insert " ")\r
81 > +     (put-text-property (1- (point)) (point) 'invisible t)\r
82 >       (widget-insert "\n")\r
83 >  \r
84 >       (when notmuch-hello-recent-searches\r
85 > diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello\r
86 > index 64b7e42..48143bd 100644\r
87 > --- a/test/emacs.expected-output/notmuch-hello\r
88 > +++ b/test/emacs.expected-output/notmuch-hello\r
89 > @@ -4,7 +4,7 @@ Saved searches: [edit]\r
90 >  \r
91 >         50 inbox           50 unread    \r
92 >  \r
93 > -Search:                                                                     \r
94 > +Search:                                                                      \r
95 >  \r
96 >  [Show all tags]\r
97 >  \r
98 > diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
99 > index 7f8206a..7c09e40 100644\r
100 > --- a/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
101 > +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
102 > @@ -1,6 +1,6 @@\r
103 >     Welcome to notmuch. You have 50 messages.\r
104 >  \r
105 > -Search:                                                                     \r
106 > +Search:                                                                      \r
107 >  \r
108 >  [Show all tags]\r
109 >  \r
110 > diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty\r
111 > index a9ed630..2a267c9 100644\r
112 > --- a/test/emacs.expected-output/notmuch-hello-with-empty\r
113 > +++ b/test/emacs.expected-output/notmuch-hello-with-empty\r
114 > @@ -4,7 +4,7 @@ Saved searches: [edit]\r
115 >  \r
116 >         50 inbox           50 unread           0 empty     \r
117 >  \r
118 > -Search:                                                                     \r
119 > +Search:                                                                      \r
120 >  \r
121 >  [Show all tags]\r
122 >  \r
123 > -- \r
124 > 1.7.5.4\r
125\r
126 > _______________________________________________\r
127 > notmuch mailing list\r
128 > notmuch@notmuchmail.org\r
129 > http://notmuchmail.org/mailman/listinfo/notmuch\r
130 \r
131 \r
132 Definitely an improvement!\r
133 \r
134 \r
135 But Kan-Ru Chen posted a similar patch [1] about a year ago,\r
136 which I've been keeping in my personal branch (and rebasing)\r
137 for way too long.\r
138 \r
139 Care to comment on the differences in approach?\r
140 \r
141 \r
142 Peace\r
143 \r
144 -- \r
145 Pieter\r
146 \r
147 [1] id:"1280195325-9066-2-git-send-email-kanru@kanru.info"\r