Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C6D3D431FB6 for ; Mon, 4 Jul 2011 00:24:24 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hY42VROqeig7 for ; Mon, 4 Jul 2011 00:24:23 -0700 (PDT) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 5E1EA431FD0 for ; Mon, 4 Jul 2011 00:24:23 -0700 (PDT) Received: by wwj40 with SMTP id 40so3874189wwj.2 for ; Mon, 04 Jul 2011 00:24:22 -0700 (PDT) Received: by 10.216.78.198 with SMTP id g48mr5492296wee.45.1309764260571; Mon, 04 Jul 2011 00:24:20 -0700 (PDT) Received: from localhost ([109.131.160.67]) by mx.google.com with ESMTPS id v60sm389632wer.34.2011.07.04.00.24.18 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Jul 2011 00:24:19 -0700 (PDT) From: Pieter Praet To: Dmitry Kurochkin , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: add insisible space after the search widget field in notmuch-hello In-Reply-To: <1309762025-1172-1-git-send-email-dmitry.kurochkin@gmail.com> References: <1309762025-1172-1-git-send-email-dmitry.kurochkin@gmail.com> User-Agent: Notmuch/0.5-326-ga5de9f3 (http://notmuchmail.org) Emacs/23.1.50.1 (x86_64-pc-linux-gnu) Date: Mon, 04 Jul 2011 09:24:17 +0200 Message-ID: <87zkkuv78e.fsf@praet.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2011 07:24:24 -0000 On Mon, 4 Jul 2011 10:47:05 +0400, Dmitry Kurochkin wrote: > It is very convenient when C-e (bound to `widget-end-of-line') ignores > trailing spaces inside the search widget. But it only does so if a > widget is not followed by a newline (that is why it works in the saved > search widgets). The patch just adds an insisible space after the > search widget to get the desirable behavior of `widget-end-of-line'. > The extra space is also added to expected results of emacs tests. > --- > emacs/notmuch-hello.el | 4 ++++ > test/emacs.expected-output/notmuch-hello | 2 +- > .../notmuch-hello-no-saved-searches | 2 +- > .../emacs.expected-output/notmuch-hello-with-empty | 2 +- > 4 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el > index 65fde75..1a76c30 100644 > --- a/emacs/notmuch-hello.el > +++ b/emacs/notmuch-hello.el > @@ -462,6 +462,10 @@ Complete list of currently available key bindings: > (length "Search: "))) > :action (lambda (widget &rest ignore) > (notmuch-hello-search (widget-value widget)))) > + ;; add an invisible space to make `widget-end-of-line' ignore > + ;; trailine spaces in the search widget field > + (widget-insert " ") > + (put-text-property (1- (point)) (point) 'invisible t) > (widget-insert "\n") > > (when notmuch-hello-recent-searches > diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello > index 64b7e42..48143bd 100644 > --- a/test/emacs.expected-output/notmuch-hello > +++ b/test/emacs.expected-output/notmuch-hello > @@ -4,7 +4,7 @@ Saved searches: [edit] > > 50 inbox 50 unread > > -Search: > +Search: > > [Show all tags] > > diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches > index 7f8206a..7c09e40 100644 > --- a/test/emacs.expected-output/notmuch-hello-no-saved-searches > +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches > @@ -1,6 +1,6 @@ > Welcome to notmuch. You have 50 messages. > > -Search: > +Search: > > [Show all tags] > > diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty > index a9ed630..2a267c9 100644 > --- a/test/emacs.expected-output/notmuch-hello-with-empty > +++ b/test/emacs.expected-output/notmuch-hello-with-empty > @@ -4,7 +4,7 @@ Saved searches: [edit] > > 50 inbox 50 unread 0 empty > > -Search: > +Search: > > [Show all tags] > > -- > 1.7.5.4 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch Definitely an improvement! But Kan-Ru Chen posted a similar patch [1] about a year ago, which I've been keeping in my personal branch (and rebasing) for way too long. Care to comment on the differences in approach? Peace -- Pieter [1] id:"1280195325-9066-2-git-send-email-kanru@kanru.info"