1 Return-Path: <dmitry.kurochkin@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 0BB71431FD0
\r
6 for <notmuch@notmuchmail.org>; Mon, 4 Jul 2011 00:37:17 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 z7wbn2LZUI6K for <notmuch@notmuchmail.org>;
\r
17 Mon, 4 Jul 2011 00:37:16 -0700 (PDT)
\r
18 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com
\r
19 [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 82836431FB6
\r
22 for <notmuch@notmuchmail.org>; Mon, 4 Jul 2011 00:37:15 -0700 (PDT)
\r
23 Received: by bwg12 with SMTP id 12so4548960bwg.26
\r
24 for <notmuch@notmuchmail.org>; Mon, 04 Jul 2011 00:37:13 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=from:to:subject:in-reply-to:references:user-agent:date:message-id
\r
27 :mime-version:content-type;
\r
28 bh=ovhF/RTu7ubKMRint6i+Z93Eo8dtF3dLNFv8SD6DC9g=;
\r
29 b=ZL+uE6fsJTIloEKMidecLmw4aSvdCCCdvW897AIgqqPgW33PZ3QSjdqb5YaxrCHmMo
\r
30 U1ygoQCLkqT1F7C+Kj/aB7lAlD/VGe1UIWjlRvJd80R6UUX45cXFLf5Kqqb8pMGv27uM
\r
31 b7hZT96UVHgS+LoTOFx2jWy/dOxfO+1Q3lhqQ=
\r
32 Received: by 10.204.7.1 with SMTP id b1mr3894708bkb.127.1309765033635;
\r
33 Mon, 04 Jul 2011 00:37:13 -0700 (PDT)
\r
34 Received: from localhost ([91.144.186.21])
\r
35 by mx.google.com with ESMTPS id t9sm5293816bkn.20.2011.07.04.00.37.11
\r
36 (version=TLSv1/SSLv3 cipher=OTHER);
\r
37 Mon, 04 Jul 2011 00:37:12 -0700 (PDT)
\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
39 To: Pieter Praet <pieter@praet.org>, notmuch@notmuchmail.org
\r
40 Subject: Re: [PATCH] emacs: add insisible space after the search widget field
\r
42 In-Reply-To: <87zkkuv78e.fsf@praet.org>
\r
43 References: <1309762025-1172-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
44 <87zkkuv78e.fsf@praet.org>
\r
45 User-Agent: Notmuch/0.5-321-g41686e2 (http://notmuchmail.org) Emacs/23.3.1
\r
46 (x86_64-pc-linux-gnu)
\r
47 Date: Mon, 04 Jul 2011 11:37:06 +0400
\r
48 Message-ID: <874o328pjx.fsf@gmail.com>
\r
50 Content-Type: text/plain; charset=us-ascii
\r
51 X-BeenThere: notmuch@notmuchmail.org
\r
52 X-Mailman-Version: 2.1.13
\r
54 List-Id: "Use and development of the notmuch mail system."
\r
55 <notmuch.notmuchmail.org>
\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
59 List-Post: <mailto:notmuch@notmuchmail.org>
\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
63 X-List-Received-Date: Mon, 04 Jul 2011 07:37:17 -0000
\r
65 On Mon, 04 Jul 2011 09:24:17 +0200, Pieter Praet <pieter@praet.org> wrote:
\r
66 > On Mon, 4 Jul 2011 10:47:05 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
\r
67 > > It is very convenient when C-e (bound to `widget-end-of-line') ignores
\r
68 > > trailing spaces inside the search widget. But it only does so if a
\r
69 > > widget is not followed by a newline (that is why it works in the saved
\r
70 > > search widgets). The patch just adds an insisible space after the
\r
71 > > search widget to get the desirable behavior of `widget-end-of-line'.
\r
72 > > The extra space is also added to expected results of emacs tests.
\r
74 > > emacs/notmuch-hello.el | 4 ++++
\r
75 > > test/emacs.expected-output/notmuch-hello | 2 +-
\r
76 > > .../notmuch-hello-no-saved-searches | 2 +-
\r
77 > > .../emacs.expected-output/notmuch-hello-with-empty | 2 +-
\r
78 > > 4 files changed, 7 insertions(+), 3 deletions(-)
\r
80 > > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
81 > > index 65fde75..1a76c30 100644
\r
82 > > --- a/emacs/notmuch-hello.el
\r
83 > > +++ b/emacs/notmuch-hello.el
\r
84 > > @@ -462,6 +462,10 @@ Complete list of currently available key bindings:
\r
85 > > (length "Search: ")))
\r
86 > > :action (lambda (widget &rest ignore)
\r
87 > > (notmuch-hello-search (widget-value widget))))
\r
88 > > + ;; add an invisible space to make `widget-end-of-line' ignore
\r
89 > > + ;; trailine spaces in the search widget field
\r
90 > > + (widget-insert " ")
\r
91 > > + (put-text-property (1- (point)) (point) 'invisible t)
\r
92 > > (widget-insert "\n")
\r
94 > > (when notmuch-hello-recent-searches
\r
95 > > diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello
\r
96 > > index 64b7e42..48143bd 100644
\r
97 > > --- a/test/emacs.expected-output/notmuch-hello
\r
98 > > +++ b/test/emacs.expected-output/notmuch-hello
\r
99 > > @@ -4,7 +4,7 @@ Saved searches: [edit]
\r
101 > > 50 inbox 50 unread
\r
106 > > [Show all tags]
\r
108 > > diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches
\r
109 > > index 7f8206a..7c09e40 100644
\r
110 > > --- a/test/emacs.expected-output/notmuch-hello-no-saved-searches
\r
111 > > +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches
\r
112 > > @@ -1,6 +1,6 @@
\r
113 > > Welcome to notmuch. You have 50 messages.
\r
118 > > [Show all tags]
\r
120 > > diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty
\r
121 > > index a9ed630..2a267c9 100644
\r
122 > > --- a/test/emacs.expected-output/notmuch-hello-with-empty
\r
123 > > +++ b/test/emacs.expected-output/notmuch-hello-with-empty
\r
124 > > @@ -4,7 +4,7 @@ Saved searches: [edit]
\r
126 > > 50 inbox 50 unread 0 empty
\r
131 > > [Show all tags]
\r
136 > > _______________________________________________
\r
137 > > notmuch mailing list
\r
138 > > notmuch@notmuchmail.org
\r
139 > > http://notmuchmail.org/mailman/listinfo/notmuch
\r
142 > Definitely an improvement!
\r
145 > But Kan-Ru Chen posted a similar patch [1] about a year ago,
\r
146 > which I've been keeping in my personal branch (and rebasing)
\r
147 > for way too long.
\r
150 ouch. I hope Carl reads this and feels your pain :)
\r
152 > Care to comment on the differences in approach?
\r
155 It is very similar. If I saw this patch earlier, I would not care to
\r
156 write mine. Comments below.
\r
158 :size (max 8 (- (window-width) notmuch-hello-indent
\r
159 - (length "Search: ")))
\r
160 + (length "Search: ") 1 ))
\r
162 Looks like this results in search widget field 1 character shorter than
\r
163 we have now. And hence not aligned with the recent search lines. I do
\r
164 not see why we need this.
\r
166 - (widget-insert "\n")
\r
167 + (widget-insert " \n")
\r
169 That was my first implementation of the patch. Later I changed it to
\r
170 make the space invisible, so you can not get to it with C-f and C-b. A
\r
171 small improvement IMO.
\r
173 I wish I saw Kan-Ru Chen's patches earlier.
\r
184 > [1] id:"1280195325-9066-2-git-send-email-kanru@kanru.info"
\r