* Malcolm Herbert ([EMAIL PROTECTED]) [020702 03:11]:
> Not sure if my list subscription has gone through yet (I haven't seen
> any confirmation so it might not have) but you might want to know about
> this anyway ...
> 
> Is there any way to limit the scope of the changes made with the -hook
> commands? For instance, I have several mailing lists for which I use a
> different address to post from, so I use something like
> 
> send-hook blah 'my_hdr From: Malcolm Herbert <[EMAIL PROTECTED]>'
> 
> to set my From: header appropriately. Unfortunately if I send to these
> lists my From: header remains changed, for the life of the session.

Right. Others have already pointed out the correct way of doing things
(using a "default" hook). I think it's worth pointing out that the hooks
do not introduce any sort of temporary environment -- that is, whatever
command they execute, it's exactly the same as if you had just executed
that same command manually. They just do it automatically when they
match a certain pattern. They never remember an old setting and set it
back when they're "finished" -- they have no concept of that. They only
are matched at certain times: folder-hook when you enter a folder,
send-hook after getting a recipient list, message-hook before formatting
a message, etc. There are no hooks for leaving a folder, leaving the
compose menu, or leaving the pager. You just use the default hook to set
a sane value next time you "enter" one of those areas.

> 
> Is there any way to limit the scope of the send-hook change to just
> the message being composed, then either reverse the change, or have it
> revert automatically?

In the time between when this message is sent and the next message is
started, it doesn't matter what the From: header says. So setting the
default hook is fine: next time the send-hook is applied, it'll be set
back. It can be seen as "lazy", but it works.

good times,
Vineet
-- 
http://www.doorstop.net/
-- 
"Computer Science is no more about computers
than astronomy is about telescopes." -E.W. Dijkstra

Attachment: msg29359/pgp00000.pgp
Description: PGP signature

Reply via email to