Re: looking for a better send-hook

2002-09-26 Thread Aaron Schrab

At 10:05 -0500 26 Sep 2002, Eugene Lee <[EMAIL PROTECTED]> wrote:
> I've tried this.  Several times.  The message-hook isn't applied when I
> select a message in index mode.  It's applied only after I view the
> currently selected message and then reply to it.

Of course message-hooks aren't applied when a message is simply selected
in the index, but they are applied when you start a reply to a message
even from the index.  I tried it before sending my previous message, and
it worked for me.  I've now tried it with 1.4, just to make *sure* that
this wasn't something that's been changed in the 1.5 development
version, and it works for me there as well.

Do you have a send-hook that's overriding the setting from the
message-hook?

-- 
Aaron Schrab [EMAIL PROTECTED]  http://www.schrab.com/aaron/
 [It is] best to confuse only one issue at a time.  -- K&R



Re: looking for a better send-hook

2002-09-26 Thread Eugene Lee

On Wed, Sep 25, 2002 at 05:49:22PM -0500, Aaron Schrab wrote:
: 
: At 16:55 -0500 25 Sep 2002, Eugene Lee <[EMAIL PROTECTED]> wrote:
: > 
: > I know message-hook supports ~h, but it only activates when I view the
: > current message.  And I don't want to remember to view a message to
: > activate the hook.  This wouldn't be a such problem with your standard
: 
: message-hooks are also applied when you begin a reply, before send-hooks
: are applied.

I've tried this.  Several times.  The message-hook isn't applied when I
select a message in index mode.  It's applied only after I view the
currently selected message and then reply to it.


-- 
Eugene Lee
[EMAIL PROTECTED]




Re: looking for a better send-hook

2002-09-26 Thread Aaron Schrab

At 16:55 -0500 25 Sep 2002, Eugene Lee <[EMAIL PROTECTED]> wrote:
> : * Eugene Lee <[EMAIL PROTECTED]> [2002-09-25 12:33]:
> : > 
> : > The command "send-hook '~h address' command"
> : > causes Mutt to generate an error "h: not supported
> : > in this mode" that isn't documented anywhere.

> I'm looking at the header "Received:" and trying to find a match within

send-hooks match against the message which was just started, and thus
they don't have Received: headers.

My parent match patch allows parts of send-hooks to match against the
message to which you are replying, but at this time ~h isn't supported
for send-hooks even when matching against the parent message.  Changing
this would require changes to mutt's internals that I haven't yet had
time to do.  It would also likely require that the patch be updated more
frequently as other parts of mutt change.

  http://www.schrab.com/aaron/mutt/patch-1.3.24.ats.parent_match.1

> I know message-hook supports ~h, but it only activates when I view the
> current message.  And I don't want to remember to view a message to
> activate the hook.  This wouldn't be a such problem with your standard

message-hooks are also applied when you begin a reply, before send-hooks
are applied.

-- 
Aaron Schrab [EMAIL PROTECTED]  http://www.schrab.com/aaron/
 I dunno, I dream in Perl sometimes... --Larry Wall



Re: looking for a better send-hook

2002-09-25 Thread Eugene Lee

On Wed, Sep 25, 2002 at 03:34:50PM +0200, Sven Guckes wrote:
: 
: * Eugene Lee <[EMAIL PROTECTED]> [2002-09-25 12:33]:
: > 
: > The command "send-hook '~h address' command"
: > causes Mutt to generate an error "h: not supported
: > in this mode" that isn't documented anywhere.
: 
: one more thing to fix in the documentation then.

BTW, I get the same error with send-hook and ~B too.  :-)

: > How do I get a send-hook to match a pattern within
: > a custom header of the current message?
: 
: do you mean "current header" as in "generated with 'my_hdr'"?

Nope.  That came off as vague.  Let me specify.

I'm looking at the header "Received:" and trying to find a match within
for the pattern "for email_address_pattern".  There's no search pattern
to look at the "Received:" header (since "Received:" is almost always a
multi-line header, the docs don't say whether its other search patterns
match multi-line headers).  That's where I'm stuck with send-hook and
trying to use "~h".

So to clarify what I meant above, "current message" is the message that
I've currrently selected in index mode, or that I'm currently viewing.
And I meant "custom header" to describe a header that's not specified
by existing Mutt search patterns.

I know message-hook supports ~h, but it only activates when I view the
current message.  And I don't want to remember to view a message to
activate the hook.  This wouldn't be a such problem with your standard
GUI mail client because selecting the current message also means viewing
the current message.  But selecting and viewing are two different things
according to Mutt, which IMO has unnecessarily complicated the way some
hooks work.

Sven, thanks for the help!


-- 
Eugene Lee
[EMAIL PROTECTED]



Re: looking for a better send-hook

2002-09-25 Thread Sven Guckes

* Eugene Lee <[EMAIL PROTECTED]> [2002-09-25 12:33]:
> The command send-hook '~h address' command
> causes Mutt to generate an error "h: not supported
> in this mode" that isn't documented anywhere.

one more thing to fix in the documentation then.

> How do I get a send-hook to match a pattern within
> a custom header of the current message?

do you mean "current header" as in "generated with 'my_hdr'"?

maybe your problem can be solved by other means -
but this required that you describe it in full.

Sven



looking for a better send-hook

2002-09-25 Thread Eugene Lee

The command:

send-hook '~h address' command

causes Mutt to generate an error "h: not supported in this mode" that
isn't documented anywhere.  How do I get a send-hook to match a pattern
within a custom header of the current message?  Thanks in advance.


-- 
Eugene Lee
[EMAIL PROTECTED]