emacs search: stash query
authorMark Walters <markwalters1009@gmail.com>
Fri, 12 Jun 2015 08:15:32 +0000 (09:15 +0100)
committerDavid Bremner <david@tethera.net>
Sat, 13 Jun 2015 06:16:56 +0000 (08:16 +0200)
Add keybinding c q to stash the current query in search mode.

emacs/notmuch.el

index f03c2f90c50217f8f54cbab499c8a7aacffc58c9..6564816f078659f23ab5f6a6c6fc51478aa695ae 100644 (file)
@@ -181,6 +181,7 @@ there will be called at other points of notmuch execution."
 (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 @@ there will be called at other points of notmuch execution."
   (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)