MH-DRAFT(5)

πŸ’Œ MH-DRAFT(5) β€” the draft folder situation, explained

okay bestie, sit down, we're talking about mh-draft β€” the draft folder facility for the nmh message system. it's giving ✨organized chaos✨ but in a good way. let me put you on.


🌸 DESCRIPTION 🌸

so there are, like, a number of interesting advanced facilities for composing outgoing mail. and they're all kinda iconic. ngl.

πŸ’– The Draft Folder πŸ’–

the commands comp, dist, forw, repl, send, and whom β€” yes, all six of them, they're a squad β€” each take these switches:

  • -draftfolder +folder
  • -draftmessage msg

and these let you manipulate the various draft messages you're composing. slay.

if -draftfolder +folder is used, your draft messages get constructed in the indicated folder. and the Draft-Folder profile entry can be used to specify a default draft folder, so you don't have to type it every single time (iykyk).

if the switch -draftmessage msg is given, that specified draft is what gets used to compose the message. but if -draftmessage msg is not used, then the draft defaults to new β€” meaning, create a new draft β€” unless you invoked comp with -use, in which case the default is cur. little exception, big consequences, we love that for us πŸŽ€

so basically, the user may have several message compositions in progress simultaneously. multitasking queen behavior. and now, all of the nmh tools are available on each of the user's message drafts β€” like show, scan, pick, and so on. periodt.

if the folder does not exist, the user is asked if it should be created β€” just like with refile, fr fr. and the last draft message the user was composing is known as cur in the draft folder. she's the main character of the folder πŸ’…

using send, the user can send drafts using the standard nmh msgs convention with -draftmessage msgs. if no msgs are given, it defaults to cur. simple as that.

in addition, all of these programs have a -nodraftfolder switch, which undoes the last occurrence of -draftfolder folder. that's lowkey useful if a default is specified in the user's nmh profile β€” like, escape hatch energy πŸ¦‹

if the user does not give the -draftfolder +folder switch, then all these commands act β€œnormally”. note that the -draft switch to send and show still refers to the file called draft in the user's nmh directory. okay so, in the interests of economy of expression, when using comp or send, 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. trust.) 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 profile:

Draft-Folder: drafts
sendf: -draftfolder +drafts

furthermore, let's assume that the program sendf is a (symbolic) link in the user's $HOME/bin/ directory to send. now,

comp
dist
forw
repl

will construct the message draft in the drafts folder using the new message number. and 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

sendf

or, if more editing was required, the draft could be edited with

comp -use

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 scan 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 work:

comp -use `pick +drafts -to nmh-workers`

or

sendf `pick +drafts -to nmh-workers`

note that in the comp example, the output from pick must resolve to a single message draft β€” it makes no sense to talk about composing two or more drafts with one invocation of comp, bestie, that's just not a thing. in contrast, in the send example, as many message drafts as desired can appear, since send doesn't mind sending more than one draft at a time. she's flexible like that πŸ’œ

note that the argument -draftfolder +folder is not included in the profile entry for send, since when comp, et al, invoke send directly, they supply send with the Unix pathname of the message draft β€” not a -draftmessage msg argument. as far as send is concerned, a draft folder is not being used. mind the gap 🧚

it is important to realize that nmh treats the draft folder like a standard nmh folder in nearly all respects. there are two exceptions:

first, under no circumstances will the -draftfolder folder switch 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

scan +drafts

it might become the current folder, depending on the context changes of the nmh program in question. so like, depends on the vibe of the program, not the switch.

second, although conceptually send deletes the msgs named in the draft folder, it does not call delete-prog to perform the deletion. sneaky little shortcut, don't @ me.

😭 What Happens if the Draft Exists

when the comp, dist, forw, and repl commands are 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).
Disposition?

the appropriate responses and their meanings are:

  • replace β€” deletes the draft and starts afresh
  • list β€” lists the draft
  • refile β€” files the draft into a folder and starts afresh
  • quit β€” leaves the draft intact and exits

in addition, if you specified -draftfolder folder to the command, then one other response will be accepted:

  • new β€” creates a new draft

just as if -draftmessage new had been given. and finally, the comp command will accept one more response:

  • use β€” re-uses the draft

just as if -use had been given. so comp gets an extra option, because of course she does. main character energy πŸ‘‘


πŸ“ FILES πŸ“

  • $HOME/.mh_profile β€” the user's profile. yes, the one. the blueprint. the source of truth 🫢

πŸŽ€ PROFILE COMPONENTS πŸŽ€

  • Draft-Folder: β€” for a default draft folder

🧭 CONTEXT 🧭

None. literally nothing. empty. void. and that's fine ✨


okay that's the whole page, you're welcome, mwah πŸ’–

this was mh-draft(5) from nmh-1.8, dated 2012-03-18 β€” yes it's vintage, and yes it still ate 🌈