Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 79 / ff34913afba067eb43053148a22fd8da61fb6e
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 DB7E2429E54\r
6         for <notmuch@notmuchmail.org>; Mon, 23 Jan 2012 15:50:12 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \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 5Pw7+K5RyLt7 for <notmuch@notmuchmail.org>;\r
17         Mon, 23 Jan 2012 15:50:12 -0800 (PST)\r
18 Received: from mail-bk0-f53.google.com (mail-bk0-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 E6B54429E21\r
22         for <notmuch@notmuchmail.org>; Mon, 23 Jan 2012 15:50:11 -0800 (PST)\r
23 Received: by mail-bk0-f53.google.com with SMTP id zt19so1828294bkb.26\r
24         for <notmuch@notmuchmail.org>; Mon, 23 Jan 2012 15:50:11 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
27         bh=QsOxy9auWMVFeZ/4kvcMXwu8sstGzRcL8AXpFd3e8Z8=;\r
28         b=dV28rQdfrE2k8UegVtK87nsZpjyt4ebczfdGvJAOSt/SMkPUFFVrzWXn8t179givlx\r
29         4lfdVnoX+wQqOqmUzmybMVoUu7hQxXEwkzJw7jFM/fv7YEvN383p8ScqXJOORa06b5sj\r
30         muq+hwKh2CJDOGznwkgjIfxe5AnnBDrg8mM/0=\r
31 Received: by 10.204.151.218 with SMTP id d26mr1345046bkw.64.1327362611592;\r
32         Mon, 23 Jan 2012 15:50:11 -0800 (PST)\r
33 Received: from localhost ([91.144.186.21])\r
34         by mx.google.com with ESMTPS id t17sm31901863bke.6.2012.01.23.15.50.10\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Mon, 23 Jan 2012 15:50:10 -0800 (PST)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v3 1/3] emacs: bind "s" to `notmuch-search' in notmuch-hello\r
40         buffer\r
41 Date: Tue, 24 Jan 2012 03:48:55 +0400\r
42 Message-Id: <1327362537-9607-2-git-send-email-dmitry.kurochkin@gmail.com>\r
43 X-Mailer: git-send-email 1.7.8.3\r
44 In-Reply-To: <1327362537-9607-1-git-send-email-dmitry.kurochkin@gmail.com>\r
45 References: <1326918176-20352-1-git-send-email-dmitry.kurochkin@gmail.com>\r
46         <1327362537-9607-1-git-send-email-dmitry.kurochkin@gmail.com>\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Mon, 23 Jan 2012 23:50:13 -0000\r
60 \r
61 Before the change, "s" in notmuch-hello buffer would jump to the\r
62 search box.  The patch changes the binding to `notmuch-search' which\r
63 is consistent with all other notmuch buffers.\r
64 ---\r
65  emacs/notmuch-hello.el                             |   19 ++++++-------------\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, 9 insertions(+), 16 deletions(-)\r
70 \r
71 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
72 index 63f2e07..d88a870 100644\r
73 --- a/emacs/notmuch-hello.el\r
74 +++ b/emacs/notmuch-hello.el\r
75 @@ -29,9 +29,6 @@\r
76  (declare-function notmuch-search "notmuch" (query &optional oldest-first target-thread target-line continuation))\r
77  (declare-function notmuch-poll "notmuch" ())\r
78  \r
79 -(defvar notmuch-hello-search-bar-marker nil\r
80 -  "The position of the search bar within the notmuch-hello buffer.")\r
81 -\r
82  (defcustom notmuch-recent-searches-max 10\r
83    "The number of recent searches to store and display."\r
84    :type 'integer\r
85 @@ -324,11 +321,6 @@ should be. Returns a cons cell `(tags-per-line width)'."\r
86        (widget-insert "\n"))\r
87      found-target-pos))\r
88  \r
89 -(defun notmuch-hello-goto-search ()\r
90 -  "Put point inside the `search' widget."\r
91 -  (interactive)\r
92 -  (goto-char notmuch-hello-search-bar-marker))\r
93 -\r
94  (defimage notmuch-hello-logo ((:type png :file "notmuch-logo.png")))\r
95  \r
96  (defun notmuch-hello-search-continuation()\r
97 @@ -358,7 +350,7 @@ should be. Returns a cons cell `(tags-per-line width)'."\r
98      (define-key map "G" 'notmuch-hello-poll-and-update)\r
99      (define-key map (kbd "<C-tab>") 'widget-backward)\r
100      (define-key map "m" 'notmuch-mua-new-mail)\r
101 -    (define-key map "s" 'notmuch-hello-goto-search)\r
102 +    (define-key map "s" 'notmuch-search)\r
103      map)\r
104    "Keymap for \"notmuch hello\" buffers.")\r
105  (fset 'notmuch-hello-mode-map notmuch-hello-mode-map)\r
106 @@ -471,7 +463,8 @@ Complete list of currently available key bindings:\r
107        (widget-insert " messages.\n"))\r
108  \r
109      (let ((found-target-pos nil)\r
110 -         (final-target-pos nil))\r
111 +         (final-target-pos nil)\r
112 +         (search-bar-pos))\r
113        (let* ((saved-alist\r
114               ;; Filter out empty saved searches if required.\r
115               (if notmuch-show-empty-saved-searches\r
116 @@ -503,7 +496,7 @@ Complete list of currently available key bindings:\r
117             (indent-rigidly start (point) notmuch-hello-indent)))\r
118  \r
119         (widget-insert "\nSearch: ")\r
120 -       (setq notmuch-hello-search-bar-marker (point-marker))\r
121 +       (setq search-bar-pos (point-marker))\r
122         (widget-create 'editable-field\r
123                        ;; Leave some space at the start and end of the\r
124                        ;; search boxes.\r
125 @@ -595,7 +588,7 @@ Complete list of currently available key bindings:\r
126         (when notmuch-saved-searches\r
127           (widget-insert "Edit saved searches with the `edit' button.\n"))\r
128         (widget-insert "Hit RET or click on a saved search or tag name to view matching threads.\n")\r
129 -       (widget-insert "`=' refreshes this screen. `s' jumps to the search box. `q' to quit.\n")\r
130 +       (widget-insert "`=' refreshes this screen. `s' to search messages. `q' to quit.\n")\r
131         (let ((fill-column (- (window-width) notmuch-hello-indent)))\r
132           (center-region start (point))))\r
133  \r
134 @@ -607,7 +600,7 @@ Complete list of currently available key bindings:\r
135           (widget-forward 1)))\r
136  \r
137        (unless (widget-at)\r
138 -       (notmuch-hello-goto-search))))\r
139 +       (goto-char search-bar-pos))))\r
140  \r
141    (run-hooks 'notmuch-hello-refresh-hook))\r
142  \r
143 diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello\r
144 index 196112e..c43ab8c 100644\r
145 --- a/test/emacs.expected-output/notmuch-hello\r
146 +++ b/test/emacs.expected-output/notmuch-hello\r
147 @@ -11,4 +11,4 @@ Search:                                                                     .\r
148          Type a search query and hit RET to view matching threads.\r
149                 Edit saved searches with the `edit' button.\r
150    Hit RET or click on a saved search or tag name to view matching threads.\r
151 -    `=' refreshes this screen. `s' jumps to the search box. `q' to quit.\r
152 +      `=' refreshes this screen. `s' to search messages. `q' to quit.\r
153 diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
154 index f4cfe49..080a56b 100644\r
155 --- a/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
156 +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
157 @@ -7,4 +7,4 @@ Search:                                                                     .\r
158          Type a search query and hit RET to view matching threads.\r
159                 Edit saved searches with the `edit' button.\r
160    Hit RET or click on a saved search or tag name to view matching threads.\r
161 -    `=' refreshes this screen. `s' jumps to the search box. `q' to quit.\r
162 +      `=' refreshes this screen. `s' to search messages. `q' to quit.\r
163 diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty\r
164 index a860a72..a9e312c 100644\r
165 --- a/test/emacs.expected-output/notmuch-hello-with-empty\r
166 +++ b/test/emacs.expected-output/notmuch-hello-with-empty\r
167 @@ -11,4 +11,4 @@ Search:                                                                     .\r
168          Type a search query and hit RET to view matching threads.\r
169                 Edit saved searches with the `edit' button.\r
170    Hit RET or click on a saved search or tag name to view matching threads.\r
171 -    `=' refreshes this screen. `s' jumps to the search box. `q' to quit.\r
172 +      `=' refreshes this screen. `s' to search messages. `q' to quit.\r
173 -- \r
174 1.7.8.3\r
175 \r