Joshua Stein <[EMAIL PROTECTED]> wrote on Tue, 06 Jun 2000:
> Anyhow, is there a way to put an external command in a
> macro so I can make:
> 
>    'm\n(list alias)\n(whatever I need to run "date +'%B %d")\n'
> 
> and be thrown right into the editor when I hit the key this macro is
> bound to?

Yes.  Put the command inside backtic quotes, ``

  'm\n(list alias)\n`date +'%B %d`\n'

(That doesn't look right, there's an unbalanced ' there, but it's close
anyway...)


In this case, I don't think you can get the ``-expansion to happen at
the actual prompt, you'll just end up with `date '+%B %d'` at the
Subject prompt.  But you can get it expand at the time when the .muttrc
is read, which may or may not be good enough for you, depending on
whether you leave your Mutt session open for days without restarting.

If .muttrc reading-time expansion of the `` command is not good enough,
you could get fancy and create a macro that runs an external command
that creates a temporary .muttrc-style command file that has the
correct, current date, and defines a macro..  This temp file would then
be sourced by the first macro, and after that the second macro would be
executed.

But it sounds like that would be too much complexity for this simple
task, when you can just get by with either restarting Mutt or
re-sourcing the .muttrc file. :-)  Still, the point is that even
current/up-to-date expansion can be done, it just gets quite tricky.


Regards,
Mikko
-- 
// Mikko Hänninen, aka. Wizzu  //  [EMAIL PROTECTED]  //  http://www.iki.fi/wiz/
// The Corrs list maintainer  //   net.freak  //   DALnet IRC operator /
// Interests: roleplaying, Linux, the Net, fantasy & scifi, the Corrs /
Microsoft is not the answer. Microsoft is the question. Linux is the answer.

Reply via email to