[neomutt-users] computed/evaluated search

Nicolas Paris nicolas.paris at riseup.net
Sat Nov 3 20:16:00 CET 2018


On Sat, Nov 03, 2018 at 10:01:28AM -0700, Ian Zimmerman wrote:
> On 2018-11-01 22:47, Nicolas Paris wrote:
> 
> > > Is there a way to use some external program to generate a searching or
> > > limiting pattern?  Hypothetically, I want something like this:
> > > 
> > > <limit> =i `get_mairix_results $my_query` <enter>
> > > 
> > 
> > Not sure that's exactly what you ask for, but I've recently written this
>   macro index L "<enter-command>unset wait_key<enter><shell-escape>\
>   read -p 'notmuch query: ' x; echo \$x >~/.cache/mutt_terms<enter>\
>   <limit>~i \"\`notmuch search --output=messages\
>   \$(cat ~/.cache/mutt_terms) |\
>   head -n 600 |\
>   perl -le '@a=<>;chomp at a;s/\^id:// \
>   for at a;s/\\+/\\\\+/g for at a;s/=/\\\\=/g \
>   for at a;$,=\"|\";print at a'\`\"<enter>" 
>   "show only messages matching a notmuch pattern"
> 
> It is far from obvious to me how this works :-P   Is this really
> supposed to work?  If so, that solves my problem 

Yes it does work, I am using it multiple time a day !

-- 
nicolas


More information about the neomutt-users mailing list