emacs search: stash query

Add keybinding c q to stash the current query in search mode.
This commit is contained in:
Mark Walters 2015-06-12 09:15:32 +01:00 committed by David Bremner
parent d038b93209
commit 4e79903449

View file

@ -181,6 +181,7 @@ there will be called at other points of notmuch execution."
(defvar notmuch-search-stash-map (defvar notmuch-search-stash-map
(let ((map (make-sparse-keymap))) (let ((map (make-sparse-keymap)))
(define-key map "i" 'notmuch-search-stash-thread-id) (define-key map "i" 'notmuch-search-stash-thread-id)
(define-key map "q" 'notmuch-stash-query)
(define-key map "?" 'notmuch-subkeymap-help) (define-key map "?" 'notmuch-subkeymap-help)
map) map)
"Submap for stash commands") "Submap for stash commands")
@ -191,6 +192,11 @@ there will be called at other points of notmuch execution."
(interactive) (interactive)
(notmuch-common-do-stash (notmuch-search-find-thread-id))) (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-query-string)
(defvar notmuch-search-target-thread) (defvar notmuch-search-target-thread)
(defvar notmuch-search-target-line) (defvar notmuch-search-target-line)