3
<META NAME="Author" CONTENT="Jerry Peek">
4
<TITLE>MH & nmh: Explanation of forwedit</TITLE>
6
<!-- $Id: e-forwed.htm,v 6.0 1999/10/10 05:14:05 jpeek Exp $ -->
8
<BODY BGCOLOR="#FFFFFF">
10
<H1>Explanation of forwedit</H1>
11
[<A HREF="e-fols.htm">previous</A>]
12
[<A HREF="e-fpick.htm">next</A>]
13
[<A HREF="tocs/jump.htm">table of contents</A>] [<A HREF="indexes/map.htm">index</A>]
15
Part of the Section about <I>forw</I>,
16
<A HREF="forfor-2.htm#forwedit">Formatting the Header</A>,
17
gives an overview of this script.
18
Here is <A HREF="../download/split/mh/bin/forwedit">the <I>forwedit</I> script</A>
19
(you might want to open it in a separate browser window).
20
To install it, first see the Section
21
<A HREF="pritba.htm">Programs in This Book's Archive</A>
22
and create the file <I>forwedit</I>.
23
If you've grabbed the archive file, you'll probably also want to extract
24
the hard link, <I>forwbatch</I>, to the file.
25
Just give <I>tar</I> both names and it will create the link automatically.
26
Otherwise, make the link with <I>ln</I>.
28
The <I>forwedit</I> link is for people who want to run an interactive
29
editor after the header is created.
30
The default editor is <I>prompter</I>, but you can change it by putting
31
an entry like this in your MH profile:
35
(Note that <I>forwedit</I> doesn't accept the <I>-editor</I> switch on
37
It only checks the MH profile.)
39
If you're using a front-end like <I>exmh</I> that does its own editing
40
of the header, you'll want add <TT>-editor forwbatch</TT> to the
41
<TT>forw:</TT> MH profile entry.
42
For plain MH, add <TT>-editor forwedit</TT> instead.
44
By default, this script makes the <TT>Subject:</TT> of the draft
45
the same as that of the message you're forwarding, plus <I>(fwd)</I> at
47
If you're forwarding more than one message, it uses the subject
48
<I>Forwarded Messages</I>.
49
You can change the way this works by editing the lines that set the
50
<I>draftsubj</I> shell variable.
52
There's one trick here:
53
Because of the way MH works, the script can only tell how many messages
54
you're forwarding (one or multiple) by reading the
55
<A HREF="getenv.htm"><I>mhmessages</I> environment variable</A>.
56
And that variable is only set if you're using the
57
<A HREF="forfor-2.htm#AnnOrMe2"><I>forw -annotate</I> switch.</A>
58
Otherwise, the script sets the forwarded subject by scanning the
60
(The alternative was to write a front-end script that grabs the
61
message numbers and eventually starts the real <I>forw</I>.
62
This got pretty messy with MH interfaces like <I>exmh</I>.)
64
When <I>forw</I> calls its editor (this script), <I>forw</I> passes the
65
pathname of the draft file that it's constructed.
66
After this script has decided on the new subject line, it calls the UNIX
67
<I>ed</I> editor to change the <TT>Subject:</TT> field in the draft.
68
Then, if you've invoked the script as <I>forwedit</I>, it calls its
69
interactive editor to let you finish the draft.
70
Or, <I>forwbatch</I> simply exits, leaving the draft for <I>forw</I> to
72
For more info on this process, see the section
73
<A HREF="senove.htm">Overview: Sending MH Messages</A>.
77
[<A HREF="tocs/jump.htm">Table of Contents</A>] [<A HREF="indexes/map.htm">Index</A>]
78
[<A HREF="e-fols.htm">Previous: Explanation of fols</A>]
79
[<A HREF="e-fpick.htm">Next: Explanation of fpick</A>]
82
<EM>Last change $Date: 1999/10/10 05:14:05 $</EM>
84
This file first appeared in the updated online edition of the book
85
<I>MH & nmh: Email for Users & Programmers</I>, by Jerry Peek.
86
Copyright © 1997 by Jerry Peek.
87
This file is freely available; you can redistribute it and/or modify
88
it under the terms of the GNU General Public License as published by
89
the Free Software Foundation. For more information, see
90
<A HREF="../copying.htm">the file <I>copying.htm</I></A>.
93
Suggestions are welcome:
94
<A HREF="http://www.jpeek.com/">Jerry Peek</A>
95
<A HREF="mailto:jpeek@jpeek.com"><jpeek@jpeek.com></A>