[PATCH v4 1/3] emacs: bind "s" to `notmuch-search' in notmuch-hello buffer
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Wed, 25 Jan 2012 01:10:52 +0000 (05:10 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:43:11 +0000 (09:43 -0800)
ba/d070d9939ddc025249ec434d882a3c3100ced5 [new file with mode: 0644]

diff --git a/ba/d070d9939ddc025249ec434d882a3c3100ced5 b/ba/d070d9939ddc025249ec434d882a3c3100ced5
new file mode 100644 (file)
index 0000000..4b41529
--- /dev/null
@@ -0,0 +1,175 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\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 83D19418C3D\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 17:12:16 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 2CrDQmmNshAT for <notmuch@notmuchmail.org>;\r
+       Tue, 24 Jan 2012 17:12:14 -0800 (PST)\r
+Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 81419431FB6\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 17:12:14 -0800 (PST)\r
+Received: by mail-bk0-f53.google.com with SMTP id zt19so2972694bkb.26\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 17:12:14 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=QsOxy9auWMVFeZ/4kvcMXwu8sstGzRcL8AXpFd3e8Z8=;\r
+       b=a6qPXbmb5PDuUX8z4tfXXgIgLs8e49JbeVN5jVO9y5H0qMSzh4dctzKTj6aFYj8Htj\r
+       TNh+PjBlZiyLtLemTgvGvw7zqQyRVw38zkJiO7cUu2REvvlXvw4ee0Mc3LnPryjXyyQr\r
+       2/rmb1ltDDhZ+YlWOAJviwaV6GGIKijrY4haQ=\r
+Received: by 10.205.132.138 with SMTP id hu10mr5025484bkc.117.1327453934129;\r
+       Tue, 24 Jan 2012 17:12:14 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id cg2sm40151079bkb.12.2012.01.24.17.12.12\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Tue, 24 Jan 2012 17:12:13 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v4 1/3] emacs: bind "s" to `notmuch-search' in notmuch-hello\r
+       buffer\r
+Date: Wed, 25 Jan 2012 05:10:52 +0400\r
+Message-Id: <1327453854-29908-2-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-Mailer: git-send-email 1.7.8.3\r
+In-Reply-To: <1327453854-29908-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1327362537-9607-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+       <1327453854-29908-1-git-send-email-dmitry.kurochkin@gmail.com>\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, 25 Jan 2012 01:12:17 -0000\r
+\r
+Before the change, "s" in notmuch-hello buffer would jump to the\r
+search box.  The patch changes the binding to `notmuch-search' which\r
+is consistent with all other notmuch buffers.\r
+---\r
+ emacs/notmuch-hello.el                             |   19 ++++++-------------\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, 9 insertions(+), 16 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+index 63f2e07..d88a870 100644\r
+--- a/emacs/notmuch-hello.el\r
++++ b/emacs/notmuch-hello.el\r
+@@ -29,9 +29,6 @@\r
+ (declare-function notmuch-search "notmuch" (query &optional oldest-first target-thread target-line continuation))\r
+ (declare-function notmuch-poll "notmuch" ())\r
\r
+-(defvar notmuch-hello-search-bar-marker nil\r
+-  "The position of the search bar within the notmuch-hello buffer.")\r
+-\r
+ (defcustom notmuch-recent-searches-max 10\r
+   "The number of recent searches to store and display."\r
+   :type 'integer\r
+@@ -324,11 +321,6 @@ should be. Returns a cons cell `(tags-per-line width)'."\r
+       (widget-insert "\n"))\r
+     found-target-pos))\r
\r
+-(defun notmuch-hello-goto-search ()\r
+-  "Put point inside the `search' widget."\r
+-  (interactive)\r
+-  (goto-char notmuch-hello-search-bar-marker))\r
+-\r
+ (defimage notmuch-hello-logo ((:type png :file "notmuch-logo.png")))\r
\r
+ (defun notmuch-hello-search-continuation()\r
+@@ -358,7 +350,7 @@ should be. Returns a cons cell `(tags-per-line width)'."\r
+     (define-key map "G" 'notmuch-hello-poll-and-update)\r
+     (define-key map (kbd "<C-tab>") 'widget-backward)\r
+     (define-key map "m" 'notmuch-mua-new-mail)\r
+-    (define-key map "s" 'notmuch-hello-goto-search)\r
++    (define-key map "s" 'notmuch-search)\r
+     map)\r
+   "Keymap for \"notmuch hello\" buffers.")\r
+ (fset 'notmuch-hello-mode-map notmuch-hello-mode-map)\r
+@@ -471,7 +463,8 @@ Complete list of currently available key bindings:\r
+       (widget-insert " messages.\n"))\r
\r
+     (let ((found-target-pos nil)\r
+-        (final-target-pos nil))\r
++        (final-target-pos nil)\r
++        (search-bar-pos))\r
+       (let* ((saved-alist\r
+             ;; Filter out empty saved searches if required.\r
+             (if notmuch-show-empty-saved-searches\r
+@@ -503,7 +496,7 @@ Complete list of currently available key bindings:\r
+           (indent-rigidly start (point) notmuch-hello-indent)))\r
\r
+       (widget-insert "\nSearch: ")\r
+-      (setq notmuch-hello-search-bar-marker (point-marker))\r
++      (setq search-bar-pos (point-marker))\r
+       (widget-create 'editable-field\r
+                      ;; Leave some space at the start and end of the\r
+                      ;; search boxes.\r
+@@ -595,7 +588,7 @@ Complete list of currently available key bindings:\r
+       (when notmuch-saved-searches\r
+         (widget-insert "Edit saved searches with the `edit' button.\n"))\r
+       (widget-insert "Hit RET or click on a saved search or tag name to view matching threads.\n")\r
+-      (widget-insert "`=' refreshes this screen. `s' jumps to the search box. `q' to quit.\n")\r
++      (widget-insert "`=' refreshes this screen. `s' to search messages. `q' to quit.\n")\r
+       (let ((fill-column (- (window-width) notmuch-hello-indent)))\r
+         (center-region start (point))))\r
\r
+@@ -607,7 +600,7 @@ Complete list of currently available key bindings:\r
+         (widget-forward 1)))\r
\r
+       (unless (widget-at)\r
+-      (notmuch-hello-goto-search))))\r
++      (goto-char search-bar-pos))))\r
\r
+   (run-hooks 'notmuch-hello-refresh-hook))\r
\r
+diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello\r
+index 196112e..c43ab8c 100644\r
+--- a/test/emacs.expected-output/notmuch-hello\r
++++ b/test/emacs.expected-output/notmuch-hello\r
+@@ -11,4 +11,4 @@ Search:                                                                     .\r
+        Type a search query and hit RET to view matching threads.\r
+               Edit saved searches with the `edit' button.\r
+   Hit RET or click on a saved search or tag name to view matching threads.\r
+-    `=' refreshes this screen. `s' jumps to the search box. `q' to quit.\r
++      `=' refreshes this screen. `s' to search messages. `q' to quit.\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 f4cfe49..080a56b 100644\r
+--- a/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
++++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
+@@ -7,4 +7,4 @@ Search:                                                                     .\r
+        Type a search query and hit RET to view matching threads.\r
+               Edit saved searches with the `edit' button.\r
+   Hit RET or click on a saved search or tag name to view matching threads.\r
+-    `=' refreshes this screen. `s' jumps to the search box. `q' to quit.\r
++      `=' refreshes this screen. `s' to search messages. `q' to quit.\r
+diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty\r
+index a860a72..a9e312c 100644\r
+--- a/test/emacs.expected-output/notmuch-hello-with-empty\r
++++ b/test/emacs.expected-output/notmuch-hello-with-empty\r
+@@ -11,4 +11,4 @@ Search:                                                                     .\r
+        Type a search query and hit RET to view matching threads.\r
+               Edit saved searches with the `edit' button.\r
+   Hit RET or click on a saved search or tag name to view matching threads.\r
+-    `=' refreshes this screen. `s' jumps to the search box. `q' to quit.\r
++      `=' refreshes this screen. `s' to search messages. `q' to quit.\r
+-- \r
+1.7.8.3\r
+\r