$book = '..'?>
include "$book/mh.php"; includeHeader('chaenv.html', 'usiinf.html'); ?>You may want to do more than an editor like vi or emacs can do to a draft message. For instance, you might want to start prompter on the new draft, then run a second editor to fill in the body. Or you might want to do something automatically each time a draft message is edited, like updating a mail message log. Or you could customize the way that a particular MH program, such as dist, handles a draft message. These are all good reasons to write a special editing shell script.
There are five things to know before you write your editor script:
Even if you don't run distprompter, it's a good example of what you can do with an MH draft editor. To run distprompter or another editor that you write, put an entry like this in your MH profile:
dist: -editor distprompter
If you write a more general purpose shell script editor for all
the MH message composing programs, you can use an MH profile entry
like this instead:
Editor: myeditor
One more note about editors: even though the
mh-profile(5) and whatnow(1) manual pages have a lot
of details, they don't explain an editor's environment or the
effect of its exit status very thoroughly. I wrote this little
test editor script that helped me learn. Maybe it'll help you:
#! /bin/sh
echo The environment of $0:
printenv
echo "Command line had: '$*'"
echo -n "Enter exit status for $0: "
read stat
exit $stat
Run it by typing, for example:
% comp -editor testedit
includeFooter('$Date: 2006-05-31 15:13:43 -0700 (Wed, 31 May 2006) $',
'OReilly: 1991, 1992, 1995');
?>