From 3c1ad5bfa0039191f1202b0542eb3af7afd16c5c Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 4 Aug 2014 21:45:20 -0400 Subject: emacs: Introduce notmuch-jump: shortcut keys to saved searches This introduces notmuch-jump, which is like a user-friendly, user-configurable global prefix map for saved searches. This provides a non-modal and much faster way to access saved searches than notmuch-hello. A user configures shortcut keys in notmuch-saved-searches, which are immediately accessible from anywhere in Notmuch under the "j" key (for "jump"). When the user hits "j", the minibuffer immediately shows a helpful table of bindings reminiscent of a completions buffer. This code is a combination of work from myself (originally, "notmuch-go"), David Edmondson, and modifications from Mark Walters. --- emacs/notmuch-lib.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'emacs/notmuch-lib.el') diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index c06baac0..19269e3c 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -25,6 +25,9 @@ (require 'mm-decode) (require 'cl) +(autoload 'notmuch-jump-search "notmuch-jump" + "Jump to a saved search by shortcut key." t) + (defgroup notmuch nil "Notmuch mail reader for Emacs." :group 'mail) @@ -138,6 +141,7 @@ For example, if you wanted to remove an \"inbox\" tag and add an (define-key map "m" 'notmuch-mua-new-mail) (define-key map "=" 'notmuch-refresh-this-buffer) (define-key map "G" 'notmuch-poll-and-refresh-this-buffer) + (define-key map "j" 'notmuch-jump-search) map) "Keymap shared by all notmuch modes.") @@ -472,6 +476,15 @@ This replaces spaces, percents, and double quotes in STR with (setq list (cdr list))) (nreverse out))) +(defun notmuch-plist-delete (plist property) + (let* ((xplist (cons nil plist)) + (pred xplist)) + (while (cdr pred) + (when (eq (cadr pred) property) + (setcdr pred (cdddr pred))) + (setq pred (cddr pred))) + (cdr xplist))) + (defun notmuch-split-content-type (content-type) "Split content/type into 'content' and 'type'" (split-string content-type "/")) -- cgit v1.2.3