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