* Semi-ready saved search
@ 2017-05-05 8:48 Tomas Nordin
2017-05-30 17:42 ` David Bremner
0 siblings, 1 reply; 3+ messages in thread
From: Tomas Nordin @ 2017-05-05 8:48 UTC (permalink / raw)
To: notmuch
Hello Notmuchers
What is a good way (with emacs) to hook into the search to modify only a
part of a search term. I find myself often doing this:
date:2d.. not is:rfile
rfile is my tag for mails that i archive locally. I am looking for a way
to query myself only for the number of days in the minibuffer. I use
this search to filter off all mailing list stuff from a search. So, in
the above example I would only have to answer 2 .
Sunny regards
--
Tomas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Semi-ready saved search
2017-05-05 8:48 Semi-ready saved search Tomas Nordin
@ 2017-05-30 17:42 ` David Bremner
2017-06-04 15:48 ` Tomas Nordin
0 siblings, 1 reply; 3+ messages in thread
From: David Bremner @ 2017-05-30 17:42 UTC (permalink / raw)
To: Tomas Nordin, notmuch
Tomas Nordin <tomasn@posteo.net> writes:
> Hello Notmuchers
>
> What is a good way (with emacs) to hook into the search to modify only a
> part of a search term. I find myself often doing this:
>
> date:2d.. not is:rfile
>
> rfile is my tag for mails that i archive locally. I am looking for a way
> to query myself only for the number of days in the minibuffer. I use
> this search to filter off all mailing list stuff from a search. So, in
> the above example I would only have to answer 2 .
One approach would be to define a function like this
(defun last-days-search(arg)
(interactive "p")
(notmuch-search (format "date:%dd.. and tag:inbox" arg)))
Then you can pass a numeric argument in the usual emacs way, e.g. if
that function is bound to C-c d, ESC 2 C-c d will give you two days.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Semi-ready saved search
2017-05-30 17:42 ` David Bremner
@ 2017-06-04 15:48 ` Tomas Nordin
0 siblings, 0 replies; 3+ messages in thread
From: Tomas Nordin @ 2017-06-04 15:48 UTC (permalink / raw)
To: David Bremner, notmuch
David Bremner <david@tethera.net> writes:
> One approach would be to define a function like this
>
> (defun last-days-search(arg)
> (interactive "p")
> (notmuch-search (format "date:%dd.. and tag:inbox" arg)))
>
> Then you can pass a numeric argument in the usual emacs way, e.g. if
> that function is bound to C-c d, ESC 2 C-c d will give you two days.
Thank you. I could easily re-shape this to behave as I want:
(defun non-list-for-days-search(arg)
(interactive "nNon-list mails during this many days: ")
(notmuch-search (format "date:%dd.. and not tag:rfile" arg)))
(define-key notmuch-hello-mode-map (kbd "S") 'non-list-for-days-search)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-04 15:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-05 8:48 Semi-ready saved search Tomas Nordin
2017-05-30 17:42 ` David Bremner
2017-06-04 15:48 ` Tomas Nordin
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).