On 24Jun2017 13:12, Xu Wang <xuwang...@gmail.com> wrote:
Hi, I have attention problem. Often times I need to check mail but I
do not want to see all mail because I feel overwhelm. I just want to
see mail I expect potentially from a single person.

Suppose I expect important email from Jian. I currently do as follows:

   mutt -e 'push "l~f'"Jian"'\n"'

It almost work. But for a splitted second, the screen shows all emails
(because it takes time to process filter request). I know this sound
weird to all, but even in this splitted second I see all emails and I
get nervous with everything I must accomplish, and I cannot focus.

Is there a way to ask mutt to wait until filter complete before show
the results, so mutt never shows all emails?

As an alternative to writing procmail filters (which require planning ahead of time, and are not well suited to ad hoc use), you could index your mail.

For example, I use notmuch: https://notmuchmail.org/

It is readily available from most package repos (so installing it is usually no more than your system's package installer, be that brew, macports, apt, yum etc).

Set it up. Run it in incremental mode regularly (eg from cron every 10 minutes or something).

When you want to see just email related to someone. Run a notmuch search for their address and run mutt on the resulting folder. Put that in a convenient script.

The search language is described here:

 https://notmuchmail.org/searching/

I have a personal script called "notmuch-search" which runs a search and then invokes mutt, here:

 https://bitbucket.org/cameron_simpson/css/src/tip/bin/notmuch-search

and _another_ script named "+++" which just says:

 notmuch-search -t ${1+"$@"}

so that invoking mutt on a search is as simple as typing:

 +++ search words here ...

Eg:

 +++ Jian      # or use Jian's email address

That makes things easy for me, and seems to match what you want.

Feel free to use my notmuch-search script; if you use it you will need the "xxargs", "arg1" and "set-x" scripts from the same place.

Cheers,
Cameron Simpson <c...@zip.com.au>

Reply via email to