]> diplodocus.org Git - nmh/blob - man/repl.man
Added context_find_prefix().
[nmh] / man / repl.man
1 .TH REPL %manext1% "December 14, 2014" "%nmhversion%"
2 .\"
3 .\" %nmhwarning%
4 .\"
5 .SH NAME
6 repl \- reply to a message
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B repl
11 .RI [ +folder ]
12 .RI [ msg ]
13 .RB [ \-annotate " | " \-noannotate ]
14 .RB [ \-group " | " \-nogroup ]
15 .RB [ \-cc
16 all/to/cc/me]
17 .RB [ \-nocc
18 all/to/cc/me]
19 .RB [ \-query " | " \-noquery ]
20 .RB [ \-form
21 .IR formfile ]
22 .RB [ \-format " | " \-noformat ]
23 .RB [ \-filter
24 .IR filterfile ]
25 .RB [ \-inplace " | " \-noinplace ]
26 .RB [ \-mime " | " \-nomime ]
27 .RB [ \-fcc
28 .IR +folder ]
29 .RB [ \-width
30 .IR columns ]
31 .RB [ \-draftfolder
32 .IR +folder ]
33 .RB [ \-draftmessage
34 .IR msg ]
35 .RB [ \-nodraftfolder ]
36 .RB [ \-editor
37 .IR editor ]
38 .RB [ \-noedit ]
39 .RB [ \-convertargs
40 .IR "type argstring" ]
41 .RB [ \-whatnowproc
42 .IR program ]
43 .RB [ \-nowhatnowproc ]
44 .RB [ \-atfile ]
45 .RB [ \-noatfile ]
46 .RB [ \-fmtproc
47 .IR program ]
48 .RB [ \-nofmtproc ]
49 .RB [ \-build ]
50 .RB [ \-file
51 .IR msgfile ]
52 .RB [ \-version ]
53 .RB [ \-help ]
54 .ad
55 .SH DESCRIPTION
56 .B Repl
57 may be used to produce a reply to an existing message.
58 .PP
59 In its simplest form (with no arguments),
60 .B repl
61 will set up a
62 message\-form skeleton in reply to the current message in the current
63 folder, and invoke the whatnow shell.
64 .PP
65 In order to construct the message draft of the reply,
66 .B repl
67 uses
68 a reply template to guide its actions. A reply template is simply a
69 .B mhl
70 format file (see
71 .IR mh\-format (5)
72 for details).
73 .PP
74 If the switch
75 .B \-nogroup
76 is given (it is on by default), then
77 .B repl
78 will use the standard forms file \*(lqreplcomps\*(rq. This will construct
79 a draft message that is intended to be sent only to the author of the
80 message to which you are replying. If a file named \*(lqreplcomps\*(rq
81 exists in the user's
82 .B nmh
83 directory, it will be used instead of this
84 default forms file.
85 .PP
86 The default reply template \*(lqreplcomps\*(rq will direct
87 .B repl
88 to construct the reply message draft as follows:
89 .PP
90 .RS 5
91 .nf
92 To: <Mail\-Reply\-To> or <Reply\-To> or <From>
93 cc: <To> and <cc> and <personal address>
94 Fcc: {fcc switch} or +outbox
95 Subject: Re: <Subject>
96 In\-Reply\-To: <Message\-Id>
97 References: <Message\-Id>
98 Comments: In\-Reply\-To <From> or <apparently from> or <Sender>
99 .ti +3
100 message dated <date>
101 --------
102 .fi
103 .RE
104 .PP
105 where field names enclosed in angle brackets (<\ >) indicate the
106 contents of the named field from the message to which the reply is
107 being made.
108 .PP
109 By default, the \*(lqcc:\*(rq field is empty. You may selectively add
110 addresses to this default with the
111 .B \-cc
112 .I type
113 switch. This switch takes an
114 argument
115 .RI ( all / to / cc / me )
116 which specifies who gets added to the default
117 \*(lqcc:\*(rq list of the reply. You may give this switch multiple times (with
118 different arguments) if you wish to add multiple types of addresses.
119 .PP
120 If the switch
121 .B \-group
122 is given, then
123 .B repl
124 will use the
125 standard forms file \*(lqreplgroupcomps\*(rq. This will construct a
126 draft message that is intended as a group or followup reply. If a file
127 named \*(lqreplgroupcomps\*(rq exists in the user's nmh directory, it
128 will be used instead of this default forms file, unless you specify
129 another forms file on the command line or in your profile.
130 .PP
131 The default group reply template \*(lqreplgroupcomps\*(rq will direct
132 .B repl
133 to construct the reply message draft as follows:
134 .PP
135 .RS 5
136 .nf
137 To: <Mail\-Followup\-To>
138 Subject: Re: <Subject>
139 In\-Reply\-To: Message from <From> of <Date>.
140 .ti +\w'In\-Reply\-To: 'u
141 <Message\-Id>
142 --------
143 .fi
144 .RE
145 .PP
146 or if the field <Mail\-Followup\-To> is not available:
147 .PP
148 .RS 5
149 .nf
150 To: <Mail\-Reply\-To> or <Reply\-To> or <From>
151 cc: <To> and <cc> and <personal address>
152 Subject: Re: <Subject>
153 In\-Reply\-To: Message from <From> of <Date>.
154 .ti +\w'In\-Reply\-To: 'u
155 <Message\-Id>
156 --------
157 .fi
158 .RE
159 .PP
160 By default, the \*(lqcc:\*(rq contains all the addresses shown. You may
161 selectively remove addresses from this default with the
162 .B \-nocc
163 .I type
164 switch.
165 This switch takes an argument (
166 .IR all / to / cc / me )
167 which specifies who gets removed
168 from the default \*(lqcc:\*(rq list of the reply. You may give this switch
169 multiple times (with different arguments) if you wish to remove multiple types
170 of addresses.
171 .PP
172 In any case, you may specify an alternate forms file with the switch
173 .B \-form
174 .IR formfile .
175 .PP
176 The
177 .B \-query
178 switch modifies the action of
179 .B \-nocc
180 .I type
181 switch by
182 interactively asking you if each address that normally would be placed in
183 the \*(lqTo:\*(rq and \*(lqcc:\*(rq list should actually be sent a copy.
184 This is useful for special\-purpose replies. Note that the position of
185 the
186 .B \-cc
187 and
188 .B \-nocc
189 switches, like all other switches which take a
190 positive and negative form, is important.
191 .PP
192 Lines beginning with the fields \*(lqTo:\*(rq, \*(lqcc:\*(rq, and
193 \*(rqBcc:\*(rq will be standardized and have duplicate addresses removed.
194 In addition, the
195 .B \-width
196 .I columns
197 switch will guide
198 .BR repl 's
199 formatting of these fields.
200 .PP
201 If the draft already exists,
202 .B repl
203 will ask you as to the disposition
204 of the draft. A reply of
205 .B quit
206 will abort
207 .BR repl ,
208 leaving the
209 draft intact;
210 .B replace
211 will replace the existing draft with a blank
212 skeleton; and
213 .B list
214 will display the draft.
215 .PP
216 See
217 .IR comp (1)
218 for a description of the
219 .B \-editor
220 and
221 .B \-noedit
222 switches. Note that while in the editor, with
223 .B \-atfile
224 and if the current directory is writable, the message being replied
225 to is available through a link named \*(lq@\*(rq (assuming the default
226 .IR whatnowproc ).
227 In addition, the actual pathname of the message is
228 stored in the environment variable
229 .BR $editalt ,
230 and the pathname of
231 the folder containing the message is stored in the environment variable
232 .BR $mhfolder .
233 The creation of the \*(lq@\*(rq file is controlled via the
234 .B \-atfile
235 and
236 .B \-noatfile
237 options.
238 .PP
239 The
240 .B \-convertargs
241 switch directs
242 .B repl
243 to pass the arguments for
244 .I type
245 to
246 .BR mhbuild .
247 Both arguments are required;
248 .I type
249 must be non-empty while
250 .I argstring
251 can be empty, e.g., '' in a shell command line. The
252 .B \-convertargs
253 switch can be used multiple times.
254 .I %docdir%/contrib/replaliases
255 shows the use of
256 .BR "repl \-convertargs" .
257 .PP
258 Although
259 .B repl
260 uses a forms file to direct it how to construct
261 the beginning of the draft, it uses a message filter file to direct
262 it as to how the message to which you are replying should be filtered
263 (re\-formatted) in the body of the draft. The filter file for
264 .B repl
265 should be a standard form file for
266 .BR mhl ,
267 as
268 .B repl
269 will invoke
270 .B mhl
271 to format the message to which you are replying.
272 .PP
273 The switches
274 .BR \-noformat ,
275 .BR \-format ,
276 and
277 .B \-filter
278 .I filterfile
279 specify
280 which message filter file to use.
281 .PP
282 If the switch
283 .B \-noformat
284 is given (it is the default) and the
285 .B \-filter
286 switch is not used, then the message
287 to which you are replying is not included in the body of the draft.
288 .PP
289 If the switch
290 .B \-format
291 is given, then a default message filter file
292 is used. This default message filter should be adequate for most users.
293 This default filter
294 .RI \*(lq mhl.reply \*(rq
295 is:
296 .PP
297 .RS 5
298 .nf
299 %mhl_reply%
300 .fi
301 .RE
302 .PP
303 which outputs each line of the body of the message prefaced with the
304 \*(lq>\*(rq character and a space.
305 .PP
306 If a file named
307 .RI \*(lq mhl.reply \*(rq
308 exists in the user's
309 .B nmh
310 directory,
311 it will be used instead of this form. You may specify an alternate
312 message filter file with the switch
313 .B \-filter
314 .IR filterfile .
315 .PP
316 Other reply filters are commonly used, such as:
317 .PP
318 .RS 5
319 .nf
320 :
321 body:nocomponent,compwidth=9,offset=9
322 .fi
323 .RE
324 .PP
325 which says to output a blank line and then the body of the message
326 being replied\-to, indented by one tab\-stop. Another popular format
327 is:
328 .PP
329 .RS 5
330 .nf
331 message-id:nocomponent,\|nonewline,\\
332 formatfield=\*(lqIn message %{text},\ \*(rq
333 from:nocomponent,\|formatfield=\*(lq%(decode(friendly{text})) writes:\*(rq
334 body:component=\*(lq>\*(rq,\|overflowtext=\*(lq>\*(rq,\|overflowoffset=0
335 .fi
336 .RE
337 .PP
338 This message filter file cites the Message-ID and author of the message
339 being replied\-to, and then outputs each line of the body prefaced with
340 the \*(lq>\*(rq character.
341 .PP
342 You can also use an external format program to format the message body.
343 The format program is specified by the
344 .IR formatproc
345 profile entry, and is enabled by the \*(lqformat\*(rq flag. A message
346 filter using an external format program would look like this:
347 .PP
348 .RS 5
349 .nf
350 body:component=\*(lq>\*(rq,\|nowrap,\|format
351 .fi
352 .RE
353 .PP
354 See the
355 .IR mhl(1)
356 documentation for more information. The format program can be changed by
357 the
358 .B \-fmtproc
359 .I program
360 and
361 .B \-nofmtproc
362 switches.
363 .PP
364 To use the MIME rules for encapsulation, specify the
365 .B \-mime
366 switch.
367 This directs
368 .B repl
369 to generate an
370 .B mhbuild
371 composition file.
372 Note that
373 .B nmh
374 will not invoke
375 .B mhbuild
376 automatically; you must specifically give the command
377 .PP
378 .RS 5
379 What now? mime
380 .RE
381 .PP
382 prior to sending the draft.
383 .PP
384 If the
385 .B \-annotate
386 switch is given, the message being replied\-to will
387 be annotated with the lines
388 .PP
389 .RS 5
390 Replied:\ date
391 Replied:\ addrs
392 .RE
393 .PP
394 where the address list contains one line for each addressee.
395 The annotation will be done only if the message is sent directly from
396 .BR repl .
397 If the message is not sent immediately from
398 .BR repl ,
399 .RB \*(lq "comp\ \-use" \*(rq
400 may be used to re\-edit and send the constructed
401 message, but the annotations won't take place. Normally annotations are
402 done inplace in order to preserve any links to the message. You may use
403 the
404 .B \-noinplace
405 switch to change this.
406 .PP
407 Although the default template specifies that a copy of the reply will be
408 put in
409 the folder 'outbox',
410 if the
411 .B \-fcc
412 .I +folder
413 switch is given it will override the default value.
414 More than one folder, each preceded by
415 .B \-fcc
416 can
417 be named.
418 .PP
419 In addition to the standard
420 .IR mh\-format (5)
421 escapes,
422 .B repl
423 also recognizes the following additional
424 .I component
425 escape:
426 .PP
427 .RS 5
428 .nf
429 .ta \w'Escape 'u +\w'Returns 'u
430 .I "Escape Returns Description"
431 fcc string Any folders specified with `\-fcc\ folder'
432 .fi
433 .RE
434 .PP
435 To avoid reiteration,
436 .B repl
437 strips any leading `Re: ' strings from
438 the
439 .I subject
440 component.
441 .PP
442 The
443 .B \-draftfolder
444 .I +folder
445 and
446 .B \-draftmessage
447 .I msg
448 switches invoke
449 the
450 .B nmh
451 draft folder facility. This is an advanced (and highly
452 useful) feature. Consult the
453 .IR mh-draft (5)
454 man page for more
455 information.
456 .PP
457 Upon exiting from the editor,
458 .B repl
459 will invoke the
460 .B whatnow
461 program. See
462 .IR whatnow (1)
463 for a discussion of available
464 options. The invocation of this program can be inhibited by using the
465 .B \-nowhatnowproc
466 switch. (In truth of fact, it is the
467 .B whatnow
468 program which starts the initial edit. Hence,
469 .B \-nowhatnowproc
470 will
471 prevent any edit from occurring.)
472 .PP
473 The
474 .B \-build
475 switch is intended to be used by the Emacs mh-e interface
476 to
477 .BR nmh .
478 It implies
479 .BR \-nowhatnowproc .
480 It causes a file
481 .I <mh\-dir>/reply
482 to be created, containing the draft message that would normally be presented
483 to the user for editing.
484 No mail is actually sent.
485 .PP
486 The
487 .B \-file
488 .I msgfile
489 switch specifies the message to be replied to as an
490 exact filename rather than as an
491 .B nmh
492 folder and message number.
493 The same caveats apply to this option as to the
494 .B \-build
495 switch.
496 .SH FILES
497 .B repl
498 looks for all format, filter and template files in multiple locations:
499 absolute pathnames are accessed directly, tilde expansion is done on
500 usernames, and files are searched for in the user's
501 .I Mail
502 directory as specified in their profile. If not found there, the directory
503 .RI \*(lq %nmhetcdir% \*(rq
504 is checked.
505 .PP
506 .fc ^ ~
507 .nf
508 .ta \w'%nmhetcdir%/ExtraBigFileName 'u
509 ^%nmhetcdir%/replcomps~^The standard reply template
510 ^or <mh\-dir>/replcomps~^Rather than the standard template
511 ^%nmhetcdir%/replgroupcomps~^The standard `reply -group' template
512 ^or <mh\-dir>/replgroupcomps~^Rather than the standard template
513 ^%nmhetcdir%/mhl.reply~^The standard message filter
514 ^or <mh\-dir>/mhl.reply~^Rather than the standard filter
515 ^$HOME/\&.mh\(ruprofile~^The user profile
516 ^<mh\-dir>/draft~^The draft file
517 .fi
518 .SH "PROFILE COMPONENTS"
519 .fc ^ ~
520 .nf
521 .ta 2.4i
522 .ta \w'ExtraBigProfileName 'u
523 ^Path:~^To determine the user's nmh directory
524 ^Alternate\-Mailboxes:~^To determine the user's mailboxes
525 ^Current\-Folder:~^To find the default current folder
526 ^Draft\-Folder:~^To find the default draft\-folder
527 ^Editor:~^To override the default editor
528 ^Msg\-Protect:~^To set mode when creating a new message (draft)
529 ^fileproc:~^Program to refile the message
530 ^mhlproc:~^Program to filter message being replied\-to
531 ^whatnowproc:~^Program to ask the \*(lqWhat now?\*(rq questions
532 .fi
533 .SH "SEE ALSO"
534 .IR comp (1),
535 .IR forw (1),
536 .IR mhbuild (1),
537 .IR send (1),
538 .IR whatnow (1),
539 .IR mh\-format (5)
540 .PP
541 .I %docdir%/contrib/replaliases
542 .SH DEFAULTS
543 .nf
544 .RB ` +folder "' defaults to the current folder"
545 .RB ` msg "' defaults to cur"
546 .RB ` \-nogroup '
547 .RB ` "\-nocc\ all" "' with `\-nogroup', `\-cc\ all' with `\-group'"
548 .RB ` \-noannotate '
549 .RB ` \-nodraftfolder '
550 .RB ` \-noformat '
551 .RB ` \-inplace '
552 .RB ` \-nomime '
553 .RB ` \-noquery '
554 .RB ` \-noatfile '
555 .RB ` "\-width\ 72" '
556 .fi
557 .SH CONTEXT
558 If a folder is given, it will become the current folder. The message
559 replied\-to will become the current message.
560 .SH BUGS
561 If any addresses occur in the reply template, addresses in the template
562 that do not contain hosts are defaulted incorrectly. Instead of using
563 the localhost for the default,
564 .B repl
565 uses the sender's host.
566 Moral of the story: if you're going to include addresses in a reply
567 template, include the host portion of the address.
568 .PP
569 The
570 .B \-width
571 .I columns
572 switch is only used to do address-folding; other
573 headers are not line\-wrapped.
574 .PP
575 If
576 .I whatnowproc
577 is
578 .BR whatnow ,
579 then
580 .B repl
581 uses a built\-in
582 .BR whatnow ,
583 it does not actually run the
584 .B whatnow
585 program.
586 Hence, if you define your own
587 .IR whatnowproc ,
588 don't call it
589 .B whatnow
590 since
591 .B repl
592 won't run it.