diff options
| author | Tomi Ollila <tomi.ollila@iki.fi> | 2022-09-18 16:05:50 +0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2022-09-23 20:23:58 -0300 |
| commit | 3db892f43b4ac333a09dd05c8f230bf3f8d2b9e9 (patch) | |
| tree | 311e0a9fe2e09e7633eb75e4ed33141dedb66a4d /emacs/notmuch.el | |
| parent | 48d6b31485dfd3110b82fd8829063297284c78c0 (diff) | |
emacs: add notmuch-search-edit-search and notmuch-tree-edit-search
...and bind these to "E" in their respective keymaps.
Expected to be called interactively, then using read-from-minibuffer
with current search string as initial contents for editing.
(Noninteractive use makes little sense, but is supported.)
With this one can expand (as an opposite to limit) their
query and have e.g. (some of their) saved searches as search
"templates".
While at it, removed `(defvar notmuch-search-query-string)` from
notmuch-tree.el; it is unused (`notmuch-tree-basic-query` is used
instead).
Thanks to Jose Antonio Ortega Ruiz for his example for notmuch-tree
code, and better interactive use.
Diffstat (limited to 'emacs/notmuch.el')
| -rw-r--r-- | emacs/notmuch.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 5cb7acd2..26181758 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -190,6 +190,7 @@ there will be called at other points of notmuch execution." (define-key map "c" 'notmuch-search-stash-map) (define-key map "t" 'notmuch-search-filter-by-tag) (define-key map "l" 'notmuch-search-filter) + (define-key map "E" 'notmuch-search-edit-search) (define-key map [mouse-1] 'notmuch-search-show-thread) (define-key map "k" 'notmuch-tag-jump) (define-key map "*" 'notmuch-search-tag-all) @@ -1156,6 +1157,12 @@ search results and that are also tagged with the given TAG." (list (notmuch-select-tag-with-completion "Notmuch search tag: "))) (notmuch-search (concat "tag:" tag))) +(defun notmuch-search-edit-search (query) + "Edit the current search" + (interactive (list (read-from-minibuffer "Edit search: " + notmuch-search-query-string))) + (notmuch-search query notmuch-search-oldest-first)) + ;;;###autoload (defun notmuch () "Run notmuch and display saved searches, known tags, etc." |
