Re: FYI: emacs / notmuch-search-edit-search

Subject: Re: FYI: emacs / notmuch-search-edit-search

Date: Wed, 12 Jan 2022 17:59:42 +0000

To: Tomi Ollila, notmuch@notmuchmail.org

Cc:

From: jao@gnu.org


hi,

On Wed, Jan 12 2022, Tomi Ollila wrote:

> Hi all
> I've had this for a while in .emacs.d/notmuch-config.el
>
> ---
>
> (defun notmuch-search-edit-search ()
>   "Edit current search"
>   (interactive)
>   (notmuch-search (read-from-minibuffer
> 		   "Edit search: " notmuch-search-query-string)
> 		  notmuch-search-oldest-first))
>
> (define-key notmuch-search-mode-map "e" #'notmuch-search-edit-search)
>
> ---

this looks useful indeed.  if added, please consider adding also a
notmuch-tree counterpart.  in notmuch-tree-mode-map, "e" is taken for
notmuch-tree-resume-message, so perhaps "E" could be used instead,
possibly in both maps for consistency.

untested:

--8<---------------cut here---------------start------------->8---
(defun notmuch-tree-edit-search (query)
  "Edit the current search"
  (interactive (list (read-from-minibuffer "Edit search: "
                                           notmuch-search-query-string)))
  (let ((notmuch-show-process-crypto (notmuch-tree--message-process-crypto)))
    (notmuch-tree-close-message-window)
    (notmuch-tree query
                  notmuch-tree-query-context
                  nil
                  nil
                  nil
                  notmuch-tree-unthreaded
                  nil
                  notmuch-search-oldest-first)))

(define-key notmuch-tree-mode-map "E" #'notmuch-tree-edit-search)
--8<---------------cut here---------------end--------------->8---

cheers,
jao
-- 
Configuring Emacs is more of a lifestyle choice than a task that one
completes.  – Stephen A. Ramsey
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: