--- /dev/null
+Return-Path: <dme@dme.org>\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 EE2A6429E25\r
+ for <notmuch@notmuchmail.org>; Tue, 6 May 2014 07:16:25 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[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 jvChatfKDnxr for <notmuch@notmuchmail.org>;\r
+ Tue, 6 May 2014 07:16:20 -0700 (PDT)\r
+Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com\r
+ [74.125.82.50]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client\r
+ certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
+ 427AA431FD6 for <notmuch@notmuchmail.org>; Tue, 6 May 2014 07:16:20 -0700\r
+ (PDT)\r
+Received: by mail-wg0-f50.google.com with SMTP id x12so2977241wgg.9\r
+ for <notmuch@notmuchmail.org>; Tue, 06 May 2014 07:16:19 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:date:message-id;\r
+ bh=XYSvl8PuSAAHcr81492E7eFt5egw7rzl6TPD5VqyZFw=;\r
+ b=LsTweXzeG57kqdgzrl1TW5ax9jFjEo/0jC6SIKj1y3uxr/dMDjQLxk5zsOF4xE2RDm\r
+ C2Xn71LfkTcZMlwU3h6p0osxWtZjlrY9FeVNDTBOzJt+lgu+0aI0XnUcITbd/F5Wk2aE\r
+ pZKmsGNG2RGJzg5jYUch/xXVNfXJ6DIPSv76UWFsXBi3LKDp4fw/w8OA0fNLLdKMqxHA\r
+ 6Lt4wAGr25Tq7/wCbZyQ9qi1ycn2Ch9o8vgb80CqTBamx2SHxZD3W9dP9Sx9jx7y85C2\r
+ 4enJ9ePTzCkl5aYFRXXqdaZLNvkal0vf/Mf9f4fKbmckNKqdCCFzZiMeLuRKeSCHTGRn\r
+ rxxg==\r
+X-Gm-Message-State:\r
+ ALoCoQll1K15fxdP9HUQWGi6jlNY0WGb1/KsIW4DYRo9Cet424n5CHXV7fnGMjuyQ4G48V4aS5Gq\r
+X-Received: by 10.194.60.114 with SMTP id g18mr2583687wjr.61.1399385778972;\r
+ Tue, 06 May 2014 07:16:18 -0700 (PDT)\r
+Received: from hotblack-desiato.hh.sledj.net (disaster-area.hh.sledj.net.\r
+ [81.149.164.25])\r
+ by mx.google.com with ESMTPSA id v15sm756960wjq.17.2014.05.06.07.16.17\r
+ for <notmuch@notmuchmail.org>\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Tue, 06 May 2014 07:16:17 -0700 (PDT)\r
+Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
+ id 1CF8A1009A6; Tue, 6 May 2014 15:16:16 +0100 (BST)\r
+From: David Edmondson <dme@dme.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [RFC] [PATCH] emacs: Add support for saved search accelerators.\r
+Date: Tue, 6 May 2014 15:16:16 +0100\r
+Message-Id: <1399385776-19918-1-git-send-email-dme@dme.org>\r
+X-Mailer: git-send-email 2.0.0.rc0\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: Tue, 06 May 2014 14:16:26 -0000\r
+\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
+\r
+This arose out a conversation in #notmuch and Mark's patch to extend\r
+the saved search custom specification based on requirements for an\r
+external package (Austin's notmuch-go.el).\r
+\r
+Re-organising the layout of the saved searches is missing (as it's\r
+lots of fiddling about with absolute numbers and I didn't want to\r
+waste time on it if this is going nowhere), so the saved searches may\r
+not all line up correctly in notmuch-hello.\r
+\r
+ emacs/notmuch-hello.el | 8 ++++++--\r
+ emacs/notmuch-lib.el | 27 +++++++++++++++++++++++++++\r
+ 2 files changed, 33 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+index 3de5238..56379ef 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) (string :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
+@@ -551,7 +552,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
+@@ -564,7 +566,9 @@ with `notmuch-hello-query-counts'."\r
+ :notify #'notmuch-hello-widget-search\r
+ :notmuch-search-terms query\r
+ :notmuch-search-oldest-first oldest-first\r
+- name)\r
++ (if key\r
++ (concat name " (" key ")")\r
++ name))\r
+ (setq column-indent\r
+ (1+ (max 0 (- column-width (length name)))))))\r
+ (setq count (1+ count))\r
+diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+index 2941da3..9aa7ba7 100644\r
+--- a/emacs/notmuch-lib.el\r
++++ b/emacs/notmuch-lib.el\r
+@@ -130,6 +130,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 +846,32 @@ 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
++ (set-keymap-parent map nil)\r
++ (suppress-keymap map)\r
++ (dolist (saved-search notmuch-saved-searches)\r
++ (let ((key (plist-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
++ )))))\r
++ map))\r
++\r
++(defun notmuch-jump ()\r
++ "Read a saved search accelerator key and perform the associated\r
++search."\r
++ (interactive)\r
++ (read-from-minibuffer "Jump to saved search: " nil (notmuch-jump-map))\r
++ (when notmuch-jump-search\r
++ (notmuch-search (plist-get notmuch-jump-search :query)\r
++ (plist-get notmuch-jump-search :oldest-first))))\r
++\r
+ (provide 'notmuch-lib)\r
+ \r
+ ;; Local Variables:\r
+-- \r
+2.0.0.rc0\r
+\r