From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id BCE6A431FAF for ; Thu, 19 Jan 2012 15:54:11 -0800 (PST) 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 BTirZnv--33Z for ; Thu, 19 Jan 2012 15:54:11 -0800 (PST) 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 F1C99431FAE for ; Thu, 19 Jan 2012 15:54:10 -0800 (PST) Received: by wgbdt12 with SMTP id dt12so498882wgb.2 for ; Thu, 19 Jan 2012 15:54:09 -0800 (PST) Received: by 10.180.77.35 with SMTP id p3mr47751799wiw.11.1327017249651; Thu, 19 Jan 2012 15:54:09 -0800 (PST) Received: from localhost ([109.131.97.13]) by mx.google.com with ESMTPS id fd1sm30982293wib.0.2012.01.19.15.54.08 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jan 2012 15:54:09 -0800 (PST) From: Pieter Praet To: Dmitry Kurochkin Subject: [PATCH v3] emacs: add invisible dot instead of space at the end of notmuch-hello search box Date: Fri, 20 Jan 2012 00:52:14 +0100 Message-Id: <1327017134-11241-1-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.8.1 In-Reply-To: <87ipk7uu92.fsf@praet.org> References: <87ipk7uu92.fsf@praet.org> Cc: Notmuch Mail 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: Thu, 19 Jan 2012 23:54:11 -0000 From: Dmitry Kurochkin This makes `show-trailing-whitespace' happy, i.e. it does not mark the whole search box line as trailing spaces. Since the dot is invisible, this change makes no visible difference for `notmuch-hello'. Edited-by: Pieter Praet to fix the tests. --- emacs/notmuch-hello.el | 9 ++++++--- test/emacs.expected-output/notmuch-hello | 2 +- .../notmuch-hello-no-saved-searches | 2 +- .../emacs.expected-output/notmuch-hello-with-empty | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index bff95ac..55b7877 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -511,9 +511,12 @@ 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 " ") + ;; Add an invisible dot to make `widget-end-of-line' ignore + ;; trailing spaces in the search widget field. A dot is used + ;; instead of a space to make `show-trailing-whitespace' + ;; happy, i.e. avoid it marking the whole line as trailing + ;; spaces. + (widget-insert ".") (put-text-property (1- (point)) (point) 'invisible t) (widget-insert "\n") diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello index de57de2..196112e 100644 --- a/test/emacs.expected-output/notmuch-hello +++ b/test/emacs.expected-output/notmuch-hello @@ -4,7 +4,7 @@ Saved searches: [edit] 52 inbox 52 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 f1fc4d6..f4cfe49 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 52 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 dd8728b..a860a72 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] 52 inbox 52 unread 0 empty -Search: +Search: . [Show all tags] -- 1.7.8.1