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

Re: [PATCH] expand mutt vars as we do environment vars



Seeing that cool group patch Thomas just posted, I thought it might be
a good time to sneak in this feature patch too. I haven't received any
negative feedback so far - now that it's in CVS, it may be a
different story ;)

On Wednesday, 21 September 2005 at 23:07, Brendan Cully wrote:
> On Friday, 16 September 2005 at 21:58, Brendan Cully wrote:
> > The attached patch causes mutt to expand mutt variables in the same
> > way that it expands environment variables. For example, you could do
> > something like this in a hook:
> > 
> > set sendmail="mysmtp -f $from"
> > 
> > A couple of gotchas: environment variables take precedence, and I
> > haven't gotten around to expanding them in a couple of places (notably
> > shell-escape).
> > 
> > At the very least it sets the stage for an easy way of doing xterm
> > titles :)
> 
> Here's a cute extension of that patch that allows you to define your
> own variables. Any variable starting with my_ will be created if you
> attempt to set it (and destroyed if you unset it). So you can do some
> neat macros that actually clean up after themselves, eg:
> 
> macro index,pager \eS '<enter-command>set my_pd="$pipe_decode"<enter>
>                        <enter-command>unset pipe_decode<enter>
>                        <pipe_message>sa-learn --spam<enter>
>                        <enter-command>set pipe_decode="$my_pd"</enter>'
> 
> I think it's useful - I always hated that limitation.
> 
> Now, if this gets extended to expand variables and % expandos in
> shell-exec all kinds of things are possible...
> 
> -b

Attachment: pgpXcN7mQmzpG.pgp
Description: PGP signature