Semi-ready saved search

classic Classic list List threaded Threaded
3 messages Options
Tomas Nordin Tomas Nordin
Reply | Threaded
Open this post in threaded view
|

Semi-ready saved search

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
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: Semi-ready saved search

Tomas Nordin <[hidden email]> 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.

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Tomas Nordin Tomas Nordin
Reply | Threaded
Open this post in threaded view
|

Re: Semi-ready saved search

David Bremner <[hidden email]> 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)
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch