]> diplodocus.org Git - nmh/blob - man/mh-draft.man
Added note that suffixes were removed from filenames of temporary files.
[nmh] / man / mh-draft.man
1 .TH MH-DRAFT %manext5% "November 6, 2012" "%nmhversion%"
2 .\"
3 .\" %nmhwarning%
4 .\"
5 .SH NAME
6 mh-draft \- draft folder facility for nmh message system
7 .SH DESCRIPTION
8 There are a number of interesting advanced facilities for the composition of
9 outgoing mail.
10 .PP
11 .SS "The Draft Folder"
12 The
13 .BR comp ,
14 .BR dist ,
15 .BR forw ,
16 .BR repl ,
17 and
18 .B whom
19 commands have two additional switches,
20 .B \-draftfolder
21 .I +folder
22 and
23 .B \-draftmessage
24 .I msg
25 which allow you to manipulate the various draft messages you are composing.
26 .PP
27 If
28 .B \-draftfolder
29 .I +folder
30 is used, these commands are
31 directed to construct a draft message in the indicated folder.
32 (The
33 .RI \*(lq Draft\-Folder \*(rq
34 profile entry may be used to declare a default draft folder for use with
35 .BR comp ,
36 .BR dist ,
37 .BR forw ,
38 .BR repl ,
39 and
40 .B whom ).
41 .PP
42 If the switch
43 .B \-draftmessage
44 .I msg
45 is given, the specified draft is used to compose the message. If
46 .B \-draftmessage
47 .I msg
48 is not used, then the
49 draft defaults to `new' (create a new draft) unless the user invokes
50 .B comp
51 with
52 .BR \-use ,
53 in which case the default is `cur'.
54 .PP
55 Hence, the user may have several message compositions in progress
56 simultaneously. Now, all of the
57 .B nmh
58 tools are available on each of the user's message drafts (e.g.
59 .BR show ,
60 .BR scan ,
61 .BR pick ,
62 and so on). If the folder does not exist, the user is asked if it should be
63 created (just like with
64 .BR refile ).
65 Also, the last draft message
66 the user was composing is known as `cur' in the draft folder.
67 .PP
68 Furthermore, the
69 .B send
70 command has these switches as well. Hence,
71 from the shell, the user can send off whatever drafts desired using the
72 standard
73 .B nmh
74 `msgs' convention with
75 .B \-draftmessage
76 .IR msgs .
77 If no `msgs' are given, it defaults to `cur'.
78 .PP
79 In addition, all five programs have a
80 .B \-nodraftfolder
81 switch, which undoes the last occurrence of
82 .B \-draftfolder
83 .I folder
84 (useful if the latter occurs in the user's
85 .B nmh
86 profile).
87 .PP
88 If the user does not give the
89 .B \-draftfolder
90 .I +folder
91 switch, then all these commands act \*(lqnormally\*(rq. Note that the
92 .B \-draft
93 switch to
94 .B send
95 and
96 .B show
97 still refers to the file called `draft' in the user's
98 .B nmh
99 directory. In the interests of economy of expression, when using
100 .B comp
101 or
102 .BR send ,
103 the user needn't prefix the draft `msg' or `msgs' with
104 .BR \-draftmessage .
105 Both of these
106 commands accept a `file' or `files' argument, and they will, if given
107 .B \-draftfolder
108 .I +folder
109 treat these arguments as `msg' or `msgs'. (This may appear to be
110 inconsistent, at first, but it saves a lot of typing) Hence,
111 .PP
112 .RS
113 .nf
114 send -draftfolder +drafts first
115 .fi
116 .RE
117 .PP
118 is the same as
119 .PP
120 .RS
121 .nf
122 send -draftfolder +drafts -draftmessage first
123 .fi
124 .RE
125 .PP
126 To make all this a bit more clear, here are some examples. Let's assume
127 that the following entries are in the
128 .B nmh
129 profile:
130 .PP
131 .RS 5
132 .nf
133 Draft\-Folder: +drafts
134 sendf: \-draftfolder +drafts
135 .fi
136 .RE
137 .PP
138 Furthermore, let's assume that the program
139 .B sendf
140 is a (symbolic) link in the user's
141 .I $HOME/bin/
142 directory to
143 .BR send .
144 Then, any of the commands
145 .PP
146 .RS 5
147 .nf
148 comp
149 dist
150 forw
151 repl
152 .fi
153 .RE
154 .PP
155 constructs the message draft in the `draft' folder using the `new'
156 message number. Furthermore, they each define `cur' in this folder to
157 be that message draft. If the user were to use the
158 .B quit
159 option at `What now?' level, then later on, if no other draft composition
160 was done, the draft could be sent with simply
161 .PP
162 .RS 5
163 .nf
164 sendf
165 .fi
166 .RE
167 .PP
168 Or, if more editing was required, the draft could be edited with
169 .PP
170 .RS 5
171 .nf
172 comp -use
173 .fi
174 .RE
175 .PP
176 Instead, if other drafts had been composed in the meantime, so that this
177 message draft was no longer known as `cur' in the `draft' folder, then
178 the user could
179 .B scan
180 the folder to see which message draft in the
181 folder should be used for editing or sending. Clever users could even
182 employ a backquoted
183 .B pick
184 to do the work:
185 .PP
186 .RS 5
187 .nf
188 comp -use `pick +drafts -to nmh-workers`
189 .fi
190 .RE
191 .PP
192 or
193 .PP
194 .RS 5
195 .nf
196 sendf `pick +drafts -to nmh-workers`
197 .fi
198 .RE
199 .PP
200 Note that in the
201 .B comp
202 example, the output from
203 .B pick
204 must resolve to a single message draft (it makes no sense to talk about
205 composing two or more drafts with one invocation of
206 .BR comp ).
207 In contrast, in the
208 .B send
209 example, as many message drafts as desired can appear, since
210 .B send
211 doesn't mind sending more than one draft at a time.
212 .PP
213 Note that the argument
214 .B \-draftfolder
215 .I +folder
216 is not included in the profile entry for
217 .BR send ,
218 since when
219 .BR comp ,
220 et. al., invoke
221 .B send
222 directly, they supply
223 .B send
224 with the UNIX pathname of the message draft, and
225 .B not
226 a
227 .B \-draftmessage
228 .I msg
229 argument. As far as
230 .B send
231 is concerned, a draft folder is not being used.
232 .PP
233 It is important to realize that
234 .B nmh
235 treats the draft folder like a standard
236 .B nmh
237 folder in nearly all respects. There are two exceptions:
238 .PP
239 First, under no circumstancs will the
240 .B \-draftfolder
241 .I folder
242 switch cause the named folder to become the current folder.
243 .PP
244 Obviously, if the folder appeared in the context of a standard
245 .I +folder
246 argument to an
247 .B nmh
248 program, as in
249 .PP
250 .RS 5
251 .nf
252 scan +drafts
253 .fi
254 .RE
255 .PP
256 it might become the current folder, depending on the context changes of the
257 .B nmh
258 program in question.
259 .PP
260 Second, although conceptually
261 .B send
262 deletes the `msgs' named in the draft folder, it does not call
263 .I delete\-prog
264 to perform the deletion.
265 .SS "What Happens if the Draft Exists"
266 When the
267 .BR comp ,
268 .BR dist ,
269 .BR forw ,
270 and
271 .B repl
272 commands
273 are invoked and the draft you indicated already exists, these programs
274 will prompt the user for a reponse directing the program's action.
275 The prompt is
276 .PP
277 .RS 5
278 .nf
279 Draft ``/home/foobar/nmhbox/draft'' exists (xx bytes).
280 Disposition?
281 .fi
282 .RE
283 .PP
284 The appropriate responses and their meanings are:
285 .PP
286 .RS 5
287 .fc ^ ~
288 .nf
289 .ta \w'replace 'u
290 .BR ^replace~^ "- deletes the draft and starts afresh"
291 .BR ^list~^ "- lists the draft"
292 .BR ^refile~^ "- files the draft into a folder and starts afresh"
293 .BR ^quit~^ "- leaves the draft intact and exits"
294 .fi
295 .RE
296 .PP
297 In addition, if you specified
298 .B \-draftfolder
299 .I folder
300 to the command, then one other response will be accepted:
301 .PP
302 .RS 5
303 .fc ^ ~
304 .nf
305 .ta \w'replace 'u
306 .BR ^new~^ "- finds a new draft"
307 .fi
308 .RE
309 .PP
310 just as if
311 .B \-draftmessage
312 .I new
313 had been given.
314 Finally, the
315 .B comp
316 command will accept one more response:
317 .PP
318 .RS 5
319 .fc ^ ~
320 .nf
321 .ta \w'replace 'u
322 .BR ^use~^ "- re-uses the draft"
323 .fi
324 .RE
325 .PP
326 just as if
327 .B \-use
328 had been given.
329 .SH CONTEXT
330 None