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

Re: help with formulating a better macro



On Thu, Aug 14, 2008 at 02:46:23PM +0200, Rado S wrote:
> =- Kevin Beranek wrote on Thu 14.Aug'08 at  1:44:29 -0500 -=
> 
> > I wrote a macro to automate a portion of sending myself an email
> > that will get caught by a filter and moved to a special folder. It
> > sets the From, To, Reply-To, and Subject header fields and then
> > fires up an editor to compose the email.
> 
> Set edit_headers=yes and detour $editor to a script of yours dealing
> with the necessary header changes, and reset $editor to the default
> after the mail was sent, no need to touch so many other mutt interal
> vars you'd have to reset again.

That's an excellent idea.  I really like that.

> 
> > I've tried to unset the fields as part of the macro after it fires
> > up the editor but I can't seem to find an incantation that works.
> 
> RTFM "my_hdr", the reverse is right next to it.

I'm aware of unmy_hdr.  What I was trying to say is that I attempted to
use it after the "exec mail" portion, but the unmy_hdr appears to be
executed before the prompts for sending a new email start which isn't
what I expected or wanted to happen.                                            
                             

> 
> > macro index \CR ":push ':set from=<address>; my_hdr Reply-To:
> > <address>; \ my_hdr To: <address+reminder>; my_hdr Subject:
> > ==Reminder==; \ exec mail;'\n"\n
> 
> Useless use of ":push ':...'", drop 1 level of evaluation.

I'm not quite sure what I was doing wrong before, I couldn't get it
to work without the :push, but it seems to work fine now.

> 
> -- 
> © Rado S. -- You must provide YOUR effort for your goal!
> EVERY effort counts: at least to show your attitude.
> You're responsible for ALL you do: you get what you give.


Kevin Beranek