[PATCH] emacs search: stash query

Mark Walters markwalters1009 at gmail.com
Fri Jun 12 01:15:32 PDT 2015


Add keybinding c q to stash the current query in search mode.
---

We could add something similar in show or tree mode but the query is
then partly notmuch generated (in particular the choice of thread) so
it is not so useful there.

Best wishes

Mark


emacs/notmuch.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index f03c2f9..6564816 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -181,6 +181,7 @@ (defvar notmuch-search-mode-map
 (defvar notmuch-search-stash-map
   (let ((map (make-sparse-keymap)))
     (define-key map "i" 'notmuch-search-stash-thread-id)
+    (define-key map "q" 'notmuch-stash-query)
     (define-key map "?" 'notmuch-subkeymap-help)
     map)
   "Submap for stash commands")
@@ -191,6 +192,11 @@ (defun notmuch-search-stash-thread-id ()
   (interactive)
   (notmuch-common-do-stash (notmuch-search-find-thread-id)))
 
+(defun notmuch-stash-query ()
+  "Copy current query to kill-ring."
+  (interactive)
+  (notmuch-common-do-stash (notmuch-search-get-query)))
+
 (defvar notmuch-search-query-string)
 (defvar notmuch-search-target-thread)
 (defvar notmuch-search-target-line)
-- 
2.1.4



More information about the notmuch mailing list