Evaluation of shell commands in .muttrc

2001-07-11 Thread Graeme Mathieson

As far as I can tell, anything in backticks inside .muttrc is evaluated
when .muttrc is first read.  I was wondering if it is possible to have
'lazy evaluation' instead -- ie the shell command is evaluated when the
variable is referenced.

The reason for this is that I've an extra header as follows:

my_hdr X-BOFH-Excuse: `fortune -n 80 -s bofh-excuses | tail -1`

The header stays the same for the entire mutt session.  I thought to
myself that perhaps the my_hdr was only being evaluated once, so I tried
the following instead:

send-hook . "my_hdr X-BOFH-Excuse: `fortune -n 80 -s bofh-excuses | tail -1`"

But that has the same effect, which leads me to believe that the shell
command in the backticks is only evaluated once.

The obvious solution, I guess, is to modify the $editor variable to
insert the header when I enter vim, but that fails if I re-edit the
file.

Any thoughts?
-- 
[EMAIL PROTECTED]  http://www.mathie.cx/~graeme/



Re: Evaluation of shell commands in .muttrc

2001-07-11 Thread Lars Hecking


> The header stays the same for the entire mutt session.  I thought to
> myself that perhaps the my_hdr was only being evaluated once, so I tried
> the following instead:
 
 Insert

 send-hook . 'unmy_hdr X-BOFH-Excuse:'

 before the one below. See section 4.4 Using Hooks in TFM.

> send-hook . "my_hdr X-BOFH-Excuse: `fortune -n 80 -s bofh-excuses | tail -1`"
 



Re: Evaluation of shell commands in .muttrc

2001-07-11 Thread Graeme Mathieson

On Wed, Jul 11, 2001 at 02:21:52PM +0100, Lars Hecking wrote:
> 
>  Insert
> 
>  send-hook . 'unmy_hdr X-BOFH-Excuse:'
> 
>  before the one below. See section 4.4 Using Hooks in TFM.

Um, yeah.  That works.  Thanks.
-- 
[EMAIL PROTECTED]  http://www.mathie.cx/~graeme/