* FYI: emacs / notmuch-search-edit-search
@ 2022-01-12 12:09 Tomi Ollila
2022-01-12 15:19 ` Jose Antonio Ortega Ruiz
2022-01-12 17:59 ` jao
0 siblings, 2 replies; 3+ messages in thread
From: Tomi Ollila @ 2022-01-12 12:09 UTC (permalink / raw)
To: notmuch
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)
---
It has been very useful for refining one saved search of me -- but today
it was shown been far more useful in a large saved search (one I have
for nmbug), so I eventually thought this is good thing to share.
I also have created commit for that -- and is in my copy of notmuch*.elc
but I have not been running it as the above overwrites it ;/ -- also
before long ago I had last line as 'notmuch-search-oldest-first))
which was (obviously) incorrect but did not affect me as I have set
that variable to true (which is also the default, I think).
Tomi
PS: initial version used notmuch-group-disjunctive-query-string
but it just made it mode complex and usually provided worse
content -- so if one thinks about that don't or think how use
of it can be improved :D
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: FYI: emacs / notmuch-search-edit-search
2022-01-12 12:09 FYI: emacs / notmuch-search-edit-search Tomi Ollila
@ 2022-01-12 15:19 ` Jose Antonio Ortega Ruiz
2022-01-12 17:59 ` jao
1 sibling, 0 replies; 3+ messages in thread
From: Jose Antonio Ortega Ruiz @ 2022-01-12 15:19 UTC (permalink / raw)
To: Tomi Ollila, notmuch
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
--
You don’t stop doing things because you get old.
You get old because you stop doing things.
- Rosamunde Pilcher\r
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: FYI: emacs / notmuch-search-edit-search
2022-01-12 12:09 FYI: emacs / notmuch-search-edit-search Tomi Ollila
2022-01-12 15:19 ` Jose Antonio Ortega Ruiz
@ 2022-01-12 17:59 ` jao
1 sibling, 0 replies; 3+ messages in thread
From: jao @ 2022-01-12 17:59 UTC (permalink / raw)
To: Tomi Ollila, notmuch
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\r
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-12 17:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 12:09 FYI: emacs / notmuch-search-edit-search Tomi Ollila
2022-01-12 15:19 ` Jose Antonio Ortega Ruiz
2022-01-12 17:59 ` jao
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).