Semi-ready saved search

David Bremner david at tethera.net
Tue May 30 10:42:30 PDT 2017


Tomas Nordin <tomasn at 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.



More information about the notmuch mailing list