X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=contrib%2Fnotmuch-pick%2Fnotmuch-pick.el;h=374cdfc83f4c525c9eec039c8bf79e6b958cca1a;hp=1a553d41314d23a26e2fbb6d1e60beb271b354e5;hb=da6d66e2864d32d4e6238691b66204ff86c9961e;hpb=47693539a64b884cbd9bffc9c832162848ad98f2 diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 1a553d41..374cdfc8 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -175,8 +175,8 @@ (define-key map "?" 'notmuch-help) (define-key map "a" 'notmuch-pick-archive-message-then-next) (define-key map "=" 'notmuch-pick-refresh-view) - (define-key map "s" 'notmuch-search) - (define-key map "z" 'notmuch-pick) + (define-key map "s" 'notmuch-pick-to-search) + (define-key map "z" 'notmuch-pick-to-pick) (define-key map "m" 'notmuch-pick-new-mail) (define-key map "f" 'notmuch-pick-forward-message) (define-key map "r" 'notmuch-pick-reply-sender) @@ -289,6 +289,25 @@ Does NOT change the database." (interactive) (notmuch-pick-tag "-")) +;; The next two functions close the message window before searching or +;; picking but they do so after the user has entered the query (in +;; case the user was basing the query on something in the message +;; window). + +(defun notmuch-pick-to-search () + "Run \"notmuch search\" with the given `query' and display results." + (interactive) + (let ((query (notmuch-read-query "Notmuch search: "))) + (notmuch-pick-close-message-window) + (notmuch-search query))) + +(defun notmuch-pick-to-pick () + "Run a query and display results in experimental notmuch-pick mode" + (interactive) + (let ((query (notmuch-read-query "Notmuch pick: "))) + (notmuch-pick-close-message-window) + (notmuch-pick query))) + ;; This function should be in notmuch-hello.el but we are trying to ;; minimise impact on the rest of the codebase. (defun notmuch-pick-from-hello (&optional search)