~ubuntu-branches/ubuntu/trusty/mh-book/trusty

« back to all changes in this revision

Viewing changes to mh/e-forwed.htm

  • Committer: Bazaar Package Importer
  • Author(s): Peter S Galbraith
  • Date: 2001-03-26 12:42:56 UTC
  • Revision ID: james.westby@ubuntu.com-20010326124256-philz6gf517qz8bo
Tags: upstream-9910
ImportĀ upstreamĀ versionĀ 9910

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<HTML>
 
2
<HEAD>
 
3
<META NAME="Author" CONTENT="Jerry Peek">
 
4
<TITLE>MH &amp; nmh: Explanation of forwedit</TITLE>
 
5
</HEAD>
 
6
<!-- $Id: e-forwed.htm,v 6.0 1999/10/10 05:14:05 jpeek Exp $ -->
 
7
 
 
8
<BODY BGCOLOR="#FFFFFF">
 
9
<A NAME="index1"></A>
 
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>]
 
14
<P>
 
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>.
 
27
<P>
 
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:
 
32
<PRE>
 
33
forwedit: -editor vi
 
34
</PRE>
 
35
(Note that <I>forwedit</I> doesn't accept the <I>-editor</I> switch on
 
36
its command line.
 
37
It only checks the MH profile.)
 
38
<P>
 
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&nbsp;forwbatch</TT> to the
 
41
<TT>forw:</TT> MH profile entry.
 
42
For plain MH, add <TT>-editor&nbsp;forwedit</TT> instead.
 
43
<P>
 
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
 
46
the end.
 
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.
 
51
<P>
 
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
 
59
current message.
 
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>.)
 
63
<P>
 
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
 
71
handle.
 
72
For more info on this process, see the section
 
73
<A HREF="senove.htm">Overview: Sending MH Messages</A>.
 
74
<P>
 
75
 
 
76
<P ALIGN=CENTER>
 
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>]
 
80
</P>
 
81
<HR>
 
82
<EM>Last change $Date: 1999/10/10 05:14:05 $</EM>
 
83
<P>
 
84
This file first appeared in the updated online edition of the book
 
85
<I>MH &amp; nmh: Email for Users &amp; Programmers</I>, by Jerry Peek.
 
86
Copyright &copy; 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>.
 
91
<P>
 
92
<ADDRESS>
 
93
Suggestions are welcome:
 
94
<A HREF="http://www.jpeek.com/">Jerry Peek</A>
 
95
<A HREF="mailto:jpeek@jpeek.com">&lt;jpeek@jpeek.com&gt;</A>
 
96
</ADDRESS>
 
97
</BODY>
 
98
</HTML>