--- /dev/null
+Return-Path: <m.walters@qmul.ac.uk>\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 BD8D0431FBF\r
+ for <notmuch@notmuchmail.org>; Thu, 8 May 2014 02:15:20 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+ tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+ NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 lFYIBb2kDbLL for <notmuch@notmuchmail.org>;\r
+ Thu, 8 May 2014 02:15:14 -0700 (PDT)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id A6D3A431FAE\r
+ for <notmuch@notmuchmail.org>; Thu, 8 May 2014 02:15:13 -0700 (PDT)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+ by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1WiKQ1-0000zx-O7; Thu, 08 May 2014 10:15:12 +0100\r
+Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost)\r
+ by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1WiKPh-0005Fj-AG; Thu, 08 May 2014 10:14:49 +0100\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2] emacs: Add support for saved search accelerators\r
+In-Reply-To: <1399461694-25350-2-git-send-email-dme@dme.org>\r
+References: <1399385776-19918-1-git-send-email-dme@dme.org>\r
+ <1399461694-25350-1-git-send-email-dme@dme.org>\r
+ <1399461694-25350-2-git-send-email-dme@dme.org>\r
+User-Agent: Notmuch/0.15.2+615~g78e3a93 (http://notmuchmail.org) Emacs/23.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Thu, 08 May 2014 10:14:47 +0100\r
+Message-ID: <87zjislji0.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Sender-Host-Address: 87.81.223.162\r
+X-QM-Geographic: According to ripencc,\r
+ this message was delivered by a machine in Britain (UK) (GB).\r
+X-QM-SPAM-Info: Sender has good ham record. :)\r
+X-QM-Body-MD5: 07f41aa1f7ae45e6727c096e1e45db39 (of first 20000 bytes)\r
+X-SpamAssassin-Score: -0.1\r
+X-SpamAssassin-SpamBar: /\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+ determine if it is\r
+ spam. We require at least 5.0 points to mark a message as spam.\r
+ This message scored -0.1 points.\r
+ Summary of the scoring: \r
+ * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+ provider * (markwalters1009[at]gmail.com)\r
+ * -0.1 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\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: Thu, 08 May 2014 09:15:20 -0000\r
+\r
+\r
+Hi\r
+\r
+This version looks good to me.\r
+\r
+The only slight query I have is which key to bind it to: Austin used g\r
+in notmuch-go and this uses j. Austin said on irc that he chose g\r
+because it wasn't bound and matched gmail's shortcut.\r
+\r
+Personally I like j (as it starts fewer words than g) and given that we\r
+don't match any of gmail's other bindings I don't think there is much\r
+advantage to doing so in this case.\r
+\r
+In any case that's all bikeshedding: I like this patch with either\r
+binding.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+\r
+On Wed, 07 May 2014, David Edmondson <dme@dme.org> wrote:\r
+> Extended the saved search definition to allow the inclusion of an\r
+> accelerator key for the search. Bind 'j' in the common mode map as a\r
+> leader for such accelerator keys.\r
+> ---\r
+> emacs/notmuch-hello.el | 5 ++++-\r
+> emacs/notmuch-lib.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++\r
+> 2 files changed, 50 insertions(+), 1 deletion(-)\r
+>\r
+> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+> index 3de5238..64d5aa1 100644\r
+> --- a/emacs/notmuch-hello.el\r
+> +++ b/emacs/notmuch-hello.el\r
+> @@ -85,6 +85,7 @@ searches so they still work in customize."\r
+> (group :format "%v" :inline t (const :format " Query: " :query) (string :format "%v")))\r
+> (checklist :inline t\r
+> :format "%v"\r
+> + (group :format "%v" :inline t (const :format " Key: " :key) (key-sequence :format "%v"))\r
+> (group :format "%v" :inline t (const :format "Count-Query: " :count-query) (string :format "%v"))\r
+> (group :format "%v" :inline t (const :format "" :sort-order)\r
+> (choice :tag " Sort Order"\r
+> @@ -101,6 +102,7 @@ a plist. Supported properties are\r
+> \r
+> :name Name of the search (required).\r
+> :query Search to run (required).\r
+> + :key Optional accelerator key.\r
+> :count-query Optional extra query to generate the count\r
+> shown. If not present then the :query property\r
+> is used.\r
+> @@ -551,7 +553,8 @@ with `notmuch-hello-query-counts'."\r
+> (when elem\r
+> (if (> column-indent 0)\r
+> (widget-insert (make-string column-indent ? )))\r
+> - (let* ((name (plist-get elem :name))\r
+> + (let* ((key (plist-get elem :key))\r
+> + (name (plist-get elem :name))\r
+> (query (plist-get elem :query))\r
+> (oldest-first (case (plist-get elem :sort-order)\r
+> (newest-first nil)\r
+> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+> index 2941da3..f8c5f96 100644\r
+> --- a/emacs/notmuch-lib.el\r
+> +++ b/emacs/notmuch-lib.el\r
+> @@ -25,6 +25,10 @@\r
+> (require 'mm-decode)\r
+> (require 'cl)\r
+> \r
+> +(declare-function notmuch-search "notmuch" (&optional query oldest-first target-thread target-line continuation))\r
+> +(declare-function notmuch-saved-search-get "notmuch-hello" (saved-search field))\r
+> +(defvar notmuch-saved-searches) ;; In `notmuch-hello.el'.\r
+> +\r
+> (defvar notmuch-command "notmuch"\r
+> "Command to run the notmuch binary.")\r
+> \r
+> @@ -130,6 +134,7 @@ For example, if you wanted to remove an \"inbox\" tag and add an\r
+> (define-key map "m" 'notmuch-mua-new-mail)\r
+> (define-key map "=" 'notmuch-refresh-this-buffer)\r
+> (define-key map "G" 'notmuch-poll-and-refresh-this-buffer)\r
+> + (define-key map "j" 'notmuch-jump)\r
+> map)\r
+> "Keymap shared by all notmuch modes.")\r
+> \r
+> @@ -845,6 +850,47 @@ status."\r
+> (defvar notmuch-show-process-crypto nil)\r
+> (make-variable-buffer-local 'notmuch-show-process-crypto)\r
+> \r
+> +;; Jump key support:\r
+> +\r
+> +(defvar notmuch-jump-search nil)\r
+> +(defun notmuch-jump-map ()\r
+> + (let ((map (make-sparse-keymap))\r
+> + help)\r
+> + (set-keymap-parent map minibuffer-local-map)\r
+> + (suppress-keymap map)\r
+> + (dolist (saved-search notmuch-saved-searches)\r
+> + (let ((key (notmuch-saved-search-get saved-search :key)))\r
+> + (when key\r
+> + (define-key map key `(lambda ()\r
+> + (interactive)\r
+> + (setq notmuch-jump-search ',saved-search)\r
+> + (exit-minibuffer)))\r
+> + (push (format "%s: %s"\r
+> + (propertize key 'face 'minibuffer-prompt)\r
+> + (notmuch-saved-search-get saved-search :name))\r
+> + help))))\r
+> + ;; Hitting ? displays a quick hint of the accelerators.\r
+> + (define-key map "?" `(lambda ()\r
+> + (interactive)\r
+> + (message "%s"\r
+> + (mapconcat #'identity\r
+> + ;; Reverse the list so\r
+> + ;; that elements appear\r
+> + ;; in the same order as\r
+> + ;; `notmuch-saved-searches'.\r
+> + (reverse ',help)\r
+> + " "))))\r
+> + map))\r
+> +\r
+> +(defun notmuch-jump ()\r
+> + "Read a saved search accelerator key and perform the search."\r
+> + (interactive)\r
+> + (setq notmuch-jump-search nil)\r
+> + (read-from-minibuffer "Jump to saved search: " nil (notmuch-jump-map))\r
+> + (when notmuch-jump-search\r
+> + (notmuch-search (notmuch-saved-search-get notmuch-jump-search :query)\r
+> + (notmuch-saved-search-get notmuch-jump-search :oldest-first))))\r
+> +\r
+> (provide 'notmuch-lib)\r
+> \r
+> ;; Local Variables:\r
+> -- \r
+> 2.0.0.rc0\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r