COMP(1mh)
β¨ COMP(1mh) β¨
okay bestie, sit DOWN, because this is the page for comp from the nmh crew β manual section 1mh β and it's literally the blueprint for writing a brand new message to be mailed. it's giving main character energy for your outbox. π
πΈ SYNOPSIS πΈ
comp [-help] [-version] [+folder] [msg] [-form formfile] [-use | -nouse]
[-file file] [-draftfolder +folder] [-draftmessage msg]
[-nodraftfolder] [-editor editor] [-noedit] [-width columns] [-from
address] [-to address] [-cc address] [-fcc +folder] [-subject text]
[-whatnowproc program] [-nowhatnowproc] [-build]
π DESCRIPTION π
so like. comp makes a whole new message that you're gonna mail. it copies a message form onto the draft you're composing, and then it launches an editor on that draft β unless you pass -noedit, in which case the initial edit justβ¦ doesn't happen. poof. gone. β¨
the default message template, which is called components, tells comp to build your draft like this:
From: {from switch} or <Local-Mailbox> or <username@hostname>
To: {to switch} or blank
cc: {cc switch} or blank
Fcc: {fcc switch} or +outbox
Subject: {subject switch} or blank
--------
if there's a file named components chillin' in your nmh directory, that one gets used instead of this form. you can also point at a different forms file with -form formfile. π
you can also start comp using an existing message's contents as the form. give it a +folder or a msg argument and that message becomes your message form. but β and hear me out β you cannot give it both a -form formfile and a +folder or msg argument. pick a lane bestie. also, that line of dashes (or just a blank line) has to stay between the header and the body of the message so it gets identified properly when it's sent (peep send(1)). π«Ά
the -use switch tells comp to keep editing a message you already started. like, if a comp (or dist, repl, or forw) got terminated without sending the draft, you can hop back in with comp -use and keep going. no draft left behind. π
the -file file switch says: use the named file as the message draft. simple as that.
forms you pick with -form get processed through the nmh template system β mh-format(5) has the deets. but drafts built from another message, or with -use or -file, do not go through mh-format(5). no cap.
on top of the standard mh-format(5) escapes, these component escapes are either brand new or have a lil alternate meaning:
fccβ returnsstringβ any folders specified with-fcc folderfromβ returnsstringβ any addresses specified with-from addresstoβ returnsstringβ any addresses specified with-to addressccβ returnsstringβ any addresses specified with-cc addresssubjectβ returnsstringβ any text specified with-subject text
by default the To: and cc: fields are empty, like a fresh page. you can add addresses with -to address and -cc address. and you can hand those switches over multiple times to stack up multiple addresses. obsessed. π
by default the From: field holds either whatever your Local-Mailbox profile entry says, or a system default email address. override it with -from address. the default mailbox in the Fcc: field is +outbox, and -fcc overrides that too. slay.
any text you hand to -subject lands in the Subject: field of the draft. periodt.
if the draft already exists, comp is gonna ask you what you wanna do with it. your options:
quitβ abortscomp, leaves the draft intact, untouched, unbothered βreplaceβ swaps the existing draft out for the appropriate formlistβ shows you the draftuseβ uses the draft for further compositionrefile +folderβ files the draft into the given folder and hands you a brand new draft with the appropriate form (the+folderargument torefileis required, don't skip it)
the -draftfolder +folder and -draftmessage msg switches invoke the nmh draft folder facility. this is an advanced feature and it's highly useful. go read mh-draft(5) for more, bestie. π
the -editor editor switch says which editor to use for the initial edit. once you exit the editor, comp invokes the whatnow program β whatnow(1) has the whole discussion of what options you got. you can block that invocation entirely with -nowhatnowproc. plot twist though: it's actually the whatnow program that starts the initial edit, so -nowhatnowproc stops any edit from happening at all. the way that works is so unserious. π
the -build switch is meant to be used by the Emacs mh-e interface to nmh. it implies -nowhatnowproc. it creates a file <mh-dir>/draft containing the draft message that would normally be shown to you for editing. and no mail is actually sent. it's a vibe, not a delivery. π¦
π FILES π
/etc/nmh/componentsβ the default message skeleton<mh-dir>/componentsβ your message skeleton$HOME/.mh_profileβ your profile
π PROFILE COMPONENTS π
Path:β to determine the user's nmh directoryDraft-Folder:β to specify the default draftfolderEditor:β to override the default editorMsg-Protect:β to set mode when creating a new message (draft)fileproc:β program to refile the messagewhatnowproc:β program to ask theWhat now?questions
π SEE ALSO π
dist(1), forw(1), repl(1), send(1), whatnow(1), mh-draft(5), mh-profile(5)
β¨ DEFAULTS β¨
+folderβ the current foldermsgβ the current message-nodraftfolder-nouse
πΈ CONTEXT πΈ
None
π BUGS π
if whatnowproc is whatnow, then comp uses a built-in whatnow and does not actually run the whatnow program. so if you define your own whatnowproc, don't call it whatnow, because comp won't run it. iykyk. π
okay that's the whole page, bestie!! this was nmh-1.8, dated 2022-12-22 β go compose something iconic, you got this πβ¨ππ¦πΈπ π«Ά
π¦ where this page comes from
- debian trixie: nmh 1.8-3
- ubuntu noble: nmh 1.8-1build4
- ubuntu questing: nmh 1.8-3
- ubuntu resolute: nmh 1.8-4
- ubuntu stonking: nmh 1.8-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms