<<< Date Index >>>     <<< Thread Index >>>

Re: hook conflicts...



On Fri, May 28, 2004 at 05:09:47PM -0400, David Yitzchak Cohen wrote:
> On Fri, May 28, 2004 at 04:40:56PM EDT, Matt Price wrote:
> > On Fri, May 28, 2004 at 04:11:25PM -0400, David Yitzchak Cohen wrote:
> > > On Fri, May 28, 2004 at 03:53:57PM EDT, Matt Price wrote:
> 
> > ok, so the big question is solved.  How about this problem though:  
> > 
> > send-hook "~C^sugar\.pop@utoronto\.ca" 'set 
> > signature=.mutt/sigs/signature_sweetie ; my_hdr From: Matt 
> > <matt.price@utoronto.\ ca>'
> > 
> > 
> > what's wrong with this hook?  From the manual, I would think it would
> > only match a message with sugar.pop@xxxxxxxxxxx as the ONLY recipient
> > (because of the ^).  Instead, it matches all messages with
> > sugar.pop@...  as ANY of the recipients.  Or am I missing something?
> > I have also tried it without the ~C (which seems superfluous for a
> > send-hook) -- but this seemed to make no difference -- neither fixed
> > nor gave me a syntax error.
> 
> ~C matches individual addresses in any of the typical recipient headers
> (To and Cc).  The "^" anchor simply means that my.sugar.pop@xxxxxxxxxxx
> won't match :-)
> 
> I guess you can split it into two send-hooks:
> send-hook "~C sugar\.pop@utoronto\.ca" "do sweetie stuff"
> send-hook "~C !(sugar\.pop@utoronto\.ca)" "do nonsweetie stuff"

... seems a little inelegant.  I found this in the manual:  

4.2.1.  Pattern Modifier

  Note that patterns matching 'lists' of addresses (notably c,C,p,P and
  t) match if there is at least one match in the whole list. If you want
  to make sure that all elements of that list match, you need to prefix
  your pattern with ^.  This example matches all mails which only has
  recipients from Germany.

       ^~C \.de$

... but maybe this doesn't work all the time?
interestingly, this works:

send-hook '^michelle\.murphy@utoronto\.ca' 'set 
signature=.mutt/sigs/signature_sweetie' 

but this doesn't: 

folder-hook . 'unhook send-hook ;  send-hook utoronto.ca "set signature=.mutt/s
igs/signature_official ; my_hdr From: Matthew Price <matt.price@xxxxxxxxxxx>" ;
send-hook "^michelle\.murphy@utoronto\.ca" "set signature=.mutt/sigs/signature_
sweetie ; my_hdr From: Matt <matt.price@xxxxxxxxxxx>"; set signature=/home/matt
/.mutt/sigs/signature_standard ; my_hdr From: Matt Price <matt.price@xxxxxxxxxx
a>' 
  
(sorry about the line breaks)

maybe something about the quotes?

Anyway, I need to put the kids to bed (!), so I have to quit, but if
you happen to see the answer...

thanks,

matt