mh-draft - draft folder facility for nmh message system
There are a number of interesting advanced facilities for the composition of
commands each take the switches -draftfolder +folder
and -draftmessage msg
, which allow you to manipulate the various
draft messages you are composing.
If -draftfolder +folder
is used, draft messages will be
constructed in the indicated folder. The “Draft-Folder
profile entry may be used to specify a default draft folder.
If the switch -draftmessage msg
is given, the specified draft is
used to compose the message. If -draftmessage msg
is not used,
then the draft defaults to `new' (create a new draft) unless the user invokes
, in which case the default is `cur'.
Hence, the user may have several message compositions in progress
simultaneously. Now, all of the nmh
tools are available on each of the
user's message drafts (e.g. show
, and so on).
If the folder does not exist, the user is asked if it should be created (just
like with refile
). The last draft message the user was composing is
known as `cur' in the draft folder.
, the user can send drafts using the standard nmh
convention with -draftmessage msgs
. If no `msgs' are given, it
defaults to `cur'.
In addition, all of these programs have a -nodraftfolder
undoes the last occurrence of -draftfolder folder
(useful if a
default is specified in the user's nmh
If the user does not give the -draftfolder +folder
all these commands act “normally”. Note that the -draft
switch to send
still refers to the file called `draft'
in the user's nmh
directory. In the interests of economy of expression,
when using comp
, the user needn't prefix the draft `msg'
or `msgs' with -draftmessage
. Both of these commands accept a `file' or
`files' argument and they will, if given -draftfolder +folder
treat these arguments as `msg' or `msgs'. (This may appear to be inconsistent,
at first, but it saves a lot of typing.) Hence,
send -draftfolder +drafts first
is the same as
send -draftfolder +drafts -draftmessage first
To make all this a bit more clear, here are some examples. Let's assume that the
following entries are in the nmh
sendf: -draftfolder +drafts
Furthermore, let's assume that the program sendf
is a (symbolic) link in
the user's $HOME/bin/
directory to send
will construct the message draft in the `draft' folder using the `new' message
number. Furthermore, they each define `cur' in this folder to be that message
draft. If the user were to use the quit
option at the `What now?'
prompt, then later on, if no other draft composition was done, the draft could
be sent with simply
Or, if more editing was required, the draft could be edited with
If other drafts had been composed in the meantime, so that this message draft
was no longer known as `cur' in the `draft' folder, then the user could
the folder to see which message draft should be used for editing
or sending. Clever users could even employ a backquoted pick
to do the
comp -use `pick +drafts -to nmh-workers`
sendf `pick +drafts -to nmh-workers`
Note that in the comp
example, the output from pick
to a single message draft (it makes no sense to talk about composing two or
more drafts with one invocation of comp
). In contrast, in the
example, as many message drafts as desired can appear, since
doesn't mind sending more than one draft at a time.
Note that the argument -draftfolder +folder
is not included in the
profile entry for send
, since when comp
, et al, invoke
directly, they supply send
with the Unix pathname of the
message draft; not
a -draftmessage msg
argument. As far
is concerned, a draft folder is not being used.
It is important to realize that nmh
treats the draft folder like a
folder in nearly all respects. There are two exceptions:
First, under no circumstances will the -draftfolder folder
cause the named folder to become the current folder. Obviously, if the folder
appeared in the context of a standard +folder
argument to an nmh
program, as in
it might become the current folder, depending on the context changes of the
program in question.
Second, although conceptually send
deletes the `msgs' named in the draft
folder, it does not call delete-prog
to perform the deletion.
When the comp
, and repl
invoked and the draft you indicated already exists, these programs will prompt
the user for a response directing the program's action. The prompt is
Draft ``/home/foobar/nmhbox/draft'' exists (xx bytes).
The appropriate responses and their meanings are:
- deletes the draft and starts afresh
- lists the draft
- files the draft into a folder and starts afresh
- leaves the draft intact and exits
In addition, if you specified -draftfolder folder
to the command,
then one other response will be accepted:
just as if -draftmessage new
had been given. Finally, the
command will accept one more response:
just as if -use
had been given.
- The user's profile.
- For a default draft folder