On Fri, Mar 10, 2000 at 02:20:27AM -0600, Jeremy Blosser wrote:
:Eugene Lee [[EMAIL PROTECTED]] wrote:
:> 
:> Having said this, I saw one feature in TheBat that I'd like to see Mutt
:> have someday: the ability to create and use templates for new messages,
:> replies, forwarded messages, etc.
:
:This should be possible now...
:
:1) create the templates you want, using your editor of choice
:2) create macros that change the value of 'editor' to call a script/etc.
:that processes the reply+template and calls your editor, then set 'editor'
:back to the default, eg:
:
:macro index r :set editor=replyscript<enter><reply>:set editor=default<enter>
:
:With forms of this method the "template" isn't even limited to a text-based
:construct, it can really be anything at all.

In this aspect, Mutt is far more configurable because of its ability to
call external programs to do things.  However, it's not possible to
insert information --- that Mutt already knows --- into a template
without writing another email parser.  For example, let's say I have a
template for replying to messages from a particular mailing list.  My
template might look like this:

        Hullo, %%%FROM%%%!

        I have a comment about your message about "%%%SUBJECT%%%" on %%%DATE%%%.

        ----- begin original message -----
        %%%BODY%%%
        ----- end original message -----

        %%%SIGNATURE%%%

As you can see, there is information about the email that I'd like to
insert in place of the "%%%" strings.  Mutt already knows what this
stuff is.  But there's no mechanism to pass this information onto an
external script.  Such a script has to figure this information out by
itself by parsing the headers, checking for RFC compliancy, fixing
special ISO-8859 characters, handling MIME attachments, etc.

Maybe Mutt could pass this information along as environment variables to
an external script to handle.  Or maybe when Mutt creates a temp file,
it can read in a template and substitute all the information first,
before passing the temp file onto the user's editor.


-- 
Eugene Lee
[EMAIL PROTECTED]

Reply via email to