Re: [PATCH] emacs: add insisible space after the search widget field in notmuch-hello
authorPieter Praet <pieter@praet.org>
Wed, 16 Nov 2011 11:00:19 +0000 (12:00 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:12 +0000 (09:40 -0800)
ab/f4dd80a5b2821a080ede5aa3d73fb38813da95 [new file with mode: 0644]

diff --git a/ab/f4dd80a5b2821a080ede5aa3d73fb38813da95 b/ab/f4dd80a5b2821a080ede5aa3d73fb38813da95
new file mode 100644 (file)
index 0000000..d2cce2c
--- /dev/null
@@ -0,0 +1,139 @@
+Return-Path: <pieter@praet.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 466EA429E21\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 03:01:20 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id v9OFLCwkQaMU for <notmuch@notmuchmail.org>;\r
+       Wed, 16 Nov 2011 03:01:19 -0800 (PST)\r
+Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 54784431FB6\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 03:01:19 -0800 (PST)\r
+Received: by wyg19 with SMTP id 19so338927wyg.26\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 03:01:18 -0800 (PST)\r
+Received: by 10.180.14.134 with SMTP id p6mr12510196wic.25.1321441273524;\r
+       Wed, 16 Nov 2011 03:01:13 -0800 (PST)\r
+Received: from localhost ([109.131.148.49])\r
+       by mx.google.com with ESMTPS id l2sm2920855wbn.0.2011.11.16.03.01.12\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Wed, 16 Nov 2011 03:01:12 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: add insisible space after the search widget field\r
+       in notmuch-hello\r
+In-Reply-To: <1309762025-1172-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1309762025-1172-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+User-Agent: Notmuch/0.9+76~g2fd88e6 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+Date: Wed, 16 Nov 2011 12:00:19 +0100\r
+Message-ID: <87k470fi2k.fsf@praet.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 16 Nov 2011 11:01:20 -0000\r
+\r
+On Mon,  4 Jul 2011 10:47:05 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
+> It is very convenient when C-e (bound to `widget-end-of-line') ignores\r
+> trailing spaces inside the search widget.  But it only does so if a\r
+> widget is not followed by a newline (that is why it works in the saved\r
+> search widgets).  The patch just adds an insisible space after the\r
+> search widget to get the desirable behavior of `widget-end-of-line'.\r
+> The extra space is also added to expected results of emacs tests.\r
+> ---\r
+>  emacs/notmuch-hello.el                             |    4 ++++\r
+>  test/emacs.expected-output/notmuch-hello           |    2 +-\r
+>  .../notmuch-hello-no-saved-searches                |    2 +-\r
+>  .../emacs.expected-output/notmuch-hello-with-empty |    2 +-\r
+>  4 files changed, 7 insertions(+), 3 deletions(-)\r
+> \r
+> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+> index 65fde75..1a76c30 100644\r
+> --- a/emacs/notmuch-hello.el\r
+> +++ b/emacs/notmuch-hello.el\r
+> @@ -462,6 +462,10 @@ Complete list of currently available key bindings:\r
+>                                     (length "Search: ")))\r
+>                     :action (lambda (widget &rest ignore)\r
+>                               (notmuch-hello-search (widget-value widget))))\r
+> +    ;; add an invisible space to make `widget-end-of-line' ignore\r
+> +    ;; trailine spaces in the search widget field\r
+> +    (widget-insert " ")\r
+> +    (put-text-property (1- (point)) (point) 'invisible t)\r
+>      (widget-insert "\n")\r
+>  \r
+>      (when notmuch-hello-recent-searches\r
+> diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello\r
+> index 64b7e42..48143bd 100644\r
+> --- a/test/emacs.expected-output/notmuch-hello\r
+> +++ b/test/emacs.expected-output/notmuch-hello\r
+> @@ -4,7 +4,7 @@ Saved searches: [edit]\r
+>  \r
+>        50 inbox           50 unread    \r
+>  \r
+> -Search:                                                                     \r
+> +Search:                                                                      \r
+>  \r
+>  [Show all tags]\r
+>  \r
+> diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
+> index 7f8206a..7c09e40 100644\r
+> --- a/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
+> +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
+> @@ -1,6 +1,6 @@\r
+>     Welcome to notmuch. You have 50 messages.\r
+>  \r
+> -Search:                                                                     \r
+> +Search:                                                                      \r
+>  \r
+>  [Show all tags]\r
+>  \r
+> diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty\r
+> index a9ed630..2a267c9 100644\r
+> --- a/test/emacs.expected-output/notmuch-hello-with-empty\r
+> +++ b/test/emacs.expected-output/notmuch-hello-with-empty\r
+> @@ -4,7 +4,7 @@ Saved searches: [edit]\r
+>  \r
+>        50 inbox           50 unread           0 empty     \r
+>  \r
+> -Search:                                                                     \r
+> +Search:                                                                      \r
+>  \r
+>  [Show all tags]\r
+>  \r
+> -- \r
+> 1.7.5.4\r
+> \r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+\r
+Appears to have been merged in by the powers that be: commit e972d752\r
+\r
+Thanks!\r
+\r
+\r
+Peace\r
+\r
+-- \r
+Pieter\r