Re: automatic switch mailbox for mairix Search

2011-08-03 Thread Gregor Zattler
Hi stardiviner,
* stardiviner  [03. Aug. 2011]:
> -> On [2011-08-03 13:26:11 +0200]:
>  Gregor Zattler Said: 
>> * stardiviner  [03. Aug. 2011]:
>>> I find that press "c" to switch mailbox to ".Search" ( This folder is for
>>> mairix Search result ) is not easy and cheap enough.
>>> I hope to set a bind or macro for this, when I type *,f* 
>>> to:some...@gmail.com 
>>> then press "Enter", and mutt will automatic switch to ".Search" mailbox.
>>> But it almost impossible to set a macro or key-bind for operation after
>>> pressing "Enter".
>>> There is another way a little simple is set a macro like :
>>> macro index cs "=.Search" "switch to mairix Search 
>>> result"
>>> But I do not think this is simple enough.
>>> So, 
>>> A WAY TO AUTOMATIC AFTER ENTER !!!
>> 
>> 
>> How about
>> macro index  "mairix 
>> \"$@\"=findext~="
>> macro pager  "mairix 
>> \"$@\"=findext~="
>>
>>  
> I Have tested yours. It can not input for mairix. ( this is not important: 
> Maildir
> will change into not-writable mode )

Your right, it does not work.  I really use this on a daily
basis:


macro index  
"~/bin/mymairix=findext~="

with 
~/bin/mymairix

as shown below.


HT really H this tima, gregor

~/bin/mymairix:

#!/bin/sh
#set -x

if test $# -eq 0 ; then 
echo -n ">  
 "
read FIRST REST
else 
FIRST=$1
shift
REST="$@"
fi


BIGNUM=500

if test "${FIRST}" != "-Ffmm" ; then 
MATCH="${FIRST} ${REST}"
else 
MATCH="${REST}"
fi

test "x${MATCH}x" = "xx" && exit 0
test "x${MATCH}x" = "x x" && exit 0

if test "x${FIRST}x" != "x-Ffmmx" ; then
MATCHES=$(mairix -r ${MATCH} | wc -l)
test ${MATCHES} -gt ${BIGNUM} && { echo "More than ${BIGNUM} matches.  
Force display with first Parameter -Ffmm." ; exit ; } 
test ${MATCHES} -eq 0 && { echo "No hits.  Search something else." ; exit ; 
} 
fi

mairix ${MATCH}


exit 0




Re: automatic switch mailbox for mairix Search

2011-08-03 Thread stardiviner
-> On [2011-08-03 13:26:11 +0200]:
 Gregor Zattler Said: 
> Hi stardiviner,
> * stardiviner  [03. Aug. 2011]:
> > I find that press "c" to switch mailbox to ".Search" ( This folder is for
> > mairix Search result ) is not easy and cheap enough.
> > I hope to set a bind or macro for this, when I type *,f* 
> > to:some...@gmail.com 
> > then press "Enter", and mutt will automatic switch to ".Search" mailbox.
> > But it almost impossible to set a macro or key-bind for operation after
> > pressing "Enter".
> > There is another way a little simple is set a macro like :
> > macro index cs "=.Search" "switch to mairix Search 
> > result"
> > But I do not think this is simple enough.
> > So, 
> > A WAY TO AUTOMATIC AFTER ENTER !!!
> 
> 
> How about
> macro index  "mairix 
> \"$@\"=findext~="
> macro pager  "mairix 
> \"$@\"=findext~="
>
>  
I Have tested yours. It can not input for mairix. ( this is not important: 
Maildir
will change into not-writable mode )
It is looks like this, right ?
macro index  "mairix \
\"$@\"=.Searcht~="
macro pager  "mairix \
\"$@\"=.Searcht~="



signature.asc
Description: Digital signature


Re: automatic switch mailbox for mairix Search

2011-08-03 Thread Gregor Zattler
Hi stardiviner,
* stardiviner  [03. Aug. 2011]:
> I find that press "c" to switch mailbox to ".Search" ( This folder is for
> mairix Search result ) is not easy and cheap enough.
> I hope to set a bind or macro for this, when I type *,f* to:some...@gmail.com 
> then press "Enter", and mutt will automatic switch to ".Search" mailbox.
> But it almost impossible to set a macro or key-bind for operation after
> pressing "Enter".
> There is another way a little simple is set a macro like :
> macro index cs "=.Search" "switch to mairix Search 
> result"
> But I do not think this is simple enough.
> So, 
> A WAY TO AUTOMATIC AFTER ENTER !!!


How about
macro index  "mairix 
\"$@\"=findext~="
macro pager  "mairix 
\"$@\"=findext~="
   
 

?

Ciao, Gregor
-- 
 -... --- .-. . -.. ..--.. ...-.-


automatic switch mailbox for mairix Search

2011-08-03 Thread stardiviner
I find that press "c" to switch mailbox to ".Search" ( This folder is for
mairix Search result ) is not easy and cheap enough.
I hope to set a bind or macro for this, when I type *,f* to:some...@gmail.com 
then press "Enter", and mutt will automatic switch to ".Search" mailbox.
But it almost impossible to set a macro or key-bind for operation after
pressing "Enter".
There is another way a little simple is set a macro like :
macro index cs "=.Search" "switch to mairix Search result"
But I do not think this is simple enough.
So, 
A WAY TO AUTOMATIC AFTER ENTER !!!

-- 
Blog: http://stardiviner.tumblr.com/
Homepage: http://stardiviner.dyndns-blog.com
Love Linux -> love code -> like this.


signature.asc
Description: Digital signature