COMP(1mh)

πŸ“¦
version 1.8 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 β€” returns string β€” any folders specified with -fcc folder
  • from β€” returns string β€” any addresses specified with -from address
  • to β€” returns string β€” any addresses specified with -to address
  • cc β€” returns string β€” any addresses specified with -cc address
  • subject β€” returns string β€” 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 β€” aborts comp, leaves the draft intact, untouched, unbothered βœ‹
  • replace β€” swaps the existing draft out for the appropriate form
  • list β€” shows you the draft
  • use β€” uses the draft for further composition
  • refile +folder β€” files the draft into the given folder and hands you a brand new draft with the appropriate form (the +folder argument to refile is 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 directory
  • Draft-Folder: β€” to specify the default draftfolder
  • Editor: β€” to override the default editor
  • Msg-Protect: β€” to set mode when creating a new message (draft)
  • fileproc: β€” program to refile the message
  • whatnowproc: β€” program to ask the What now? questions

🌈 SEE ALSO 🌈

dist(1), forw(1), repl(1), send(1), whatnow(1), mh-draft(5), mh-profile(5)


✨ DEFAULTS ✨

  • +folder β€” the current folder
  • msg β€” 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