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 5A63A431FD0
\r
6 for <notmuch@notmuchmail.org>; Sun, 3 Jul 2011 23:47:25 -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 0tFiTNSctUOm for <notmuch@notmuchmail.org>;
\r
17 Sun, 3 Jul 2011 23:47:17 -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 DAE6B431FB6
\r
22 for <notmuch@notmuchmail.org>; Sun, 3 Jul 2011 23:47:15 -0700 (PDT)
\r
23 Received: by bwg12 with SMTP id 12so4520393bwg.26
\r
24 for <notmuch@notmuchmail.org>; Sun, 03 Jul 2011 23:47:14 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=from:to:cc:subject:date:message-id:x-mailer;
\r
27 bh=EAfv2opfx97JTbW4RolcYfMallXGhUSm+rgCeWmhX8o=;
\r
28 b=qEvYgQBiB8vY3c+pnC99FoV6JTo6KeueEhougzk1FXJppUtO5CfMEK7a5pvORQ2HrL
\r
29 chGS/NR4bv9P5sSUgItemX2vh8Put20BWocEfq46Oabh1mIJFH4MAbOAAyZL0beGbtLk
\r
30 3rUNh+VV7yibtqCOG6GS3SBPELNBc7zZ/Hxeo=
\r
31 Received: by 10.204.233.15 with SMTP id jw15mr5274018bkb.48.1309762034387;
\r
32 Sun, 03 Jul 2011 23:47:14 -0700 (PDT)
\r
33 Received: from localhost ([91.144.186.21])
\r
34 by mx.google.com with ESMTPS id g13sm5257868bkd.10.2011.07.03.23.47.12
\r
35 (version=TLSv1/SSLv3 cipher=OTHER);
\r
36 Sun, 03 Jul 2011 23:47:13 -0700 (PDT)
\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH] emacs: add insisible space after the search widget field in
\r
41 Date: Mon, 4 Jul 2011 10:47:05 +0400
\r
42 Message-Id: <1309762025-1172-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
43 X-Mailer: git-send-email 1.7.5.4
\r
44 X-BeenThere: notmuch@notmuchmail.org
\r
45 X-Mailman-Version: 2.1.13
\r
47 List-Id: "Use and development of the notmuch mail system."
\r
48 <notmuch.notmuchmail.org>
\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
52 List-Post: <mailto:notmuch@notmuchmail.org>
\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
56 X-List-Received-Date: Mon, 04 Jul 2011 06:47:26 -0000
\r
58 It is very convenient when C-e (bound to `widget-end-of-line') ignores
\r
59 trailing spaces inside the search widget. But it only does so if a
\r
60 widget is not followed by a newline (that is why it works in the saved
\r
61 search widgets). The patch just adds an insisible space after the
\r
62 search widget to get the desirable behavior of `widget-end-of-line'.
\r
63 The extra space is also added to expected results of emacs tests.
\r
65 emacs/notmuch-hello.el | 4 ++++
\r
66 test/emacs.expected-output/notmuch-hello | 2 +-
\r
67 .../notmuch-hello-no-saved-searches | 2 +-
\r
68 .../emacs.expected-output/notmuch-hello-with-empty | 2 +-
\r
69 4 files changed, 7 insertions(+), 3 deletions(-)
\r
71 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
72 index 65fde75..1a76c30 100644
\r
73 --- a/emacs/notmuch-hello.el
\r
74 +++ b/emacs/notmuch-hello.el
\r
75 @@ -462,6 +462,10 @@ Complete list of currently available key bindings:
\r
76 (length "Search: ")))
\r
77 :action (lambda (widget &rest ignore)
\r
78 (notmuch-hello-search (widget-value widget))))
\r
79 + ;; add an invisible space to make `widget-end-of-line' ignore
\r
80 + ;; trailine spaces in the search widget field
\r
81 + (widget-insert " ")
\r
82 + (put-text-property (1- (point)) (point) 'invisible t)
\r
83 (widget-insert "\n")
\r
85 (when notmuch-hello-recent-searches
\r
86 diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello
\r
87 index 64b7e42..48143bd 100644
\r
88 --- a/test/emacs.expected-output/notmuch-hello
\r
89 +++ b/test/emacs.expected-output/notmuch-hello
\r
90 @@ -4,7 +4,7 @@ Saved searches: [edit]
\r
99 diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches
\r
100 index 7f8206a..7c09e40 100644
\r
101 --- a/test/emacs.expected-output/notmuch-hello-no-saved-searches
\r
102 +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches
\r
104 Welcome to notmuch. You have 50 messages.
\r
111 diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty
\r
112 index a9ed630..2a267c9 100644
\r
113 --- a/test/emacs.expected-output/notmuch-hello-with-empty
\r
114 +++ b/test/emacs.expected-output/notmuch-hello-with-empty
\r
115 @@ -4,7 +4,7 @@ Saved searches: [edit]
\r
117 50 inbox 50 unread 0 empty
\r