On Fri, Apr 29, 2011 at 01:56:51PM +0200, Sebastian Tramp wrote:
I have a question regarding macros in mutt. Currently I use these two macros for searching:macro generic ,f "<shell-escape>mairix " "search via mairix" macro generic ,,f "<change-folder><kill-line>=search<enter>" "load the search results mailbox" Can I optimize it in the way that after finishing the search with ,f - the result mailbox is automatically loaded?
I run mutt inside screen, and use the following macro to switch to a separate window to run a mairix query. It will open mutt on the search folder if the query is successful. Otherwise, it will exit, which returns me to the original screen session (mutt).
# prompt for mairix search parameters macro index,pager,browser ,m "\ <enter-command> set my_wait_key=\$wait_key wait_key=no<enter>\ <shell-escape>screen -X screen -t 'mutt search' sh -c 'mairixquery && mutt -f =search'<enter>\ <enter-command>set wait_key=\$my_wait_key &my_wait_key<enter>" "mairix query"In my case, mairixquery is a Perl script that prompts me for the mairix search string, gives me yes or no prompts for whether to search threads or augment previous results, and saves the most recent 100 searches so that I can make edits if the query returns too little or way too much.
It doesn't need to be that fancy for this strategy to work for you, assuming you read mutt inside screen. All it has to do is let you enter mairix command line options after the new screen has already been launched.
-- Ed Blackman
signature.txt
Description: Digital signature