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 5A63A431FD0 for ; Sun, 3 Jul 2011 23:47:25 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 0tFiTNSctUOm for ; Sun, 3 Jul 2011 23:47:17 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id DAE6B431FB6 for ; Sun, 3 Jul 2011 23:47:15 -0700 (PDT) Received: by bwg12 with SMTP id 12so4520393bwg.26 for ; Sun, 03 Jul 2011 23:47:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=EAfv2opfx97JTbW4RolcYfMallXGhUSm+rgCeWmhX8o=; b=qEvYgQBiB8vY3c+pnC99FoV6JTo6KeueEhougzk1FXJppUtO5CfMEK7a5pvORQ2HrL chGS/NR4bv9P5sSUgItemX2vh8Put20BWocEfq46Oabh1mIJFH4MAbOAAyZL0beGbtLk 3rUNh+VV7yibtqCOG6GS3SBPELNBc7zZ/Hxeo= Received: by 10.204.233.15 with SMTP id jw15mr5274018bkb.48.1309762034387; Sun, 03 Jul 2011 23:47:14 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id g13sm5257868bkd.10.2011.07.03.23.47.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jul 2011 23:47:13 -0700 (PDT) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH] emacs: add insisible space after the search widget field in notmuch-hello Date: Mon, 4 Jul 2011 10:47:05 +0400 Message-Id: <1309762025-1172-1-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.5.4 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 06:47:26 -0000 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