MH-SEQUENCE(7)
π mh-sequence π
okay so this is the manual page for mh-sequence, section 7 of the mmh manual (that's mmh-0.4 bestie, we're fancy). grab a snack, because sequences are genuinely the glow-up of the whole mh message system and you're gonna want to know about them. β¨
πΈ NAME πΈ
mh-sequence β sequence specification for mh message system
π¦ DESCRIPTION π¦
So. A sequence (or "sequence set" if you're being extra) is a symbolic name that stands for a message, or a whole lil collection of messages. mmh comes with several sequences already baked in, and it lets you define your own. both. we love range. π
β¨ Message Specification and Pre-Defined Message Sequences β¨
Most mmh commands take either a msg spec or a msgs spec β where msg means one message and msgs means one or more messages. no cap.
To point at a message you can use either its number (like 1, 10, 234) or one of these reserved message names:
fβ the first message in the folderpβ the message numerically precedingccβ the most recently accessed messagenβ the message numerically followingclβ the last message in the folder
In commands that take a msg argument, the default is c.
Example time, because this one actually slaps: in a folder containing five messages numbered 5, 10, 94, 177 and 325, f is 5 and l is 325. And if c is 94, then p is 10 and n is 177. see how that works? iconic. π
The word msgs means one or more messages may be specified. That kind of spec is made of one message designation, or several message designations separated by spaces. And a message designation is either a message name (like the ones above) or a message range.
A message range is written as name1-name2 or name:i, where name, name1 and name2 are message names and i is an integer.
The spec name1-name2 means all currently existing messages from name1 to name2, inclusive. and the reserved name a (short for "all") is just shorthand for the range f-l:
aβ all messages in the folder (i.e.f-l)
The spec name:i designates up to i messages. These start with name if name is a message number or one of the reserved names f, c, or n. They end with name if name is p or l. The interpretation of i can be overridden by sticking a plus or minus in front of it β +i always means up to i messages starting with name, and -i always means up to i messages ending with name. periodt. π₯
In commands that accept a msgs argument, the default is either c or a, depending on which one makes more sense for that command (go read the individual man pages for the deets, iykyk).
Repeated specifications of the same message have the same effect as specifying it once. (yes, saying it twice does nothing extra. we're not mad at it.)
There's also a special reserved message name b ("beyond") which you can use with the mhpath command. It refers to the next (not yet used) message number after l. π«Ά
bβ the next message number beyondl
π User-Defined Message Sequences π
On top of all those reserved (pre-defined) names, mmh supports user-defined sequence names. And honestly? this is where the power move lives. user-defined sequences give you a tremendous amount of power over groups of messages in the same folder, because you can bind a bunch of messages to a meaningful symbolic name. main character energy fr fr.
The name you use for a message sequence must be an alphabetic character followed by zero or more alphanumeric characters, and it cannot be one of the reserved message names above. Once you've defined a sequence, you can use it anywhere an mmh command expects a msg or msgs argument.
Some forms of message ranges work with user-defined sequences too:
name:iβ designates up to the firstimessages (or the lastimessages for-i) which are elements of the user-defined sequencenamename:nβ designates the next message (relative to the current message) which is an element of the user-defined sequencenamename:pβ designates the previous message (relative to the current message) which is an element of the user-defined sequencenamename:fβ equivalent toname:1name:lβ equivalent toname:-1
The spec name:c is not allowed β just use plain c instead, bestie. π
β οΈ heads up: the syntax of these message range specifications is subject to change in the future. so like, don't get too attached to the exact spelling, yeah?
User-defined sequence names are specific to each folder. They're defined using the pick and mark commands. π
π Public and Private User-Defined Sequences π
There are two flavours of user-defined sequences: public and private.
Public sequences of a folder are accessible to any mmh user that can read that folder. They live in each folder, in the file determined by the Mh-Sequences profile entry (the default is .mh_sequences). Private sequences are accessible only to the mmh user who defined them, and they're kept in the user's mh context file.
Generally, the commands that create sequences (like pick and mark) will create public sequences if the folder they're being defined for is writable by the mmh user. For most commands you can override this with the -public and -private switches. BUT β if the folder is read-only, or if the Mh-Sequences profile entry is defined but empty, then private sequences get created instead. the vibes decide. π
β Sequence Negation β
Mmh lets you select all messages that are not elements of a user-defined sequence. you do it with a special string prefixed to an existing user-defined sequence name, and the spec then refers to those messages that aren't elements of that sequence. the default negation prefix is the exclamation mark !, but you can change it to any string by defining the Sequence-Negation entry in the mmh profile file.
For example, if the profile entry is:
Sequence-Negation: not
then anytime an mmh command is given notfoo as a msg or msgs argument, it would substitute all messages that are not elements of the sequence foo. slay. π¦
Obviously, the user should beware of defining sequences with names that begin with the value of the Sequence-Negation profile entry. The default value ! was chosen because of its similar meaning in the C programming language, and because it cannot be part of a user-defined sequence.
π but if your shell provides history expansion, you might need to quote the exclamation mark (prefix it with a backslash). ask me how i know.
To deactivate the negation mechanism, define Sequence-Negation in your profile to an empty value. bye bestie π
πΈ The Previous Sequence πΈ
Mmh can remember the msgs or msg argument last given to an mmh command. The Previous-Sequence entry should be defined in the mmh profile; its value should be a sequence name, or multiple sequence names separated by spaces. If that entry is defined, then when an mmh command finishes, it will define the sequence(s) named in the value of that entry to be those messages that were specified to the command.
So a profile entry of:
Previous-Sequence: pseq
directs any mmh command that accepts a msg or msgs argument to define the sequence pseq as those messages when it finishes. cute, right? π
β οΈ note: there can be a performance penalty in using thePrevious-Sequencefacility. If it's used, all mmh programs have to write the sequence information to the.mh_sequencesfile for the folder each time they run. If thePrevious-Sequenceprofile entry is not included, onlypickandmarkwill write to the.mh_sequencesfile. so like, know the cost, queen.
π§ The Unseen Sequence π§
And finally β the unseen sequence, which indicates which messages have not been previously seen by the user. The commands inc, rcvstore, show, and flist honor this sequence.
Whenever new messages are placed in a folder (using inc or rcvstore), those new messages also get added to the unseen sequence.
inc, for example, adds new messages to the unseen sequence. Unlike the behavior of the previous sequence, though, the unseen sequence will not be zeroed by inc.
Similarly, whenever show, next, or prev display a message, that message gets removed from the unseen sequence. β¨
The default unseen sequence is named u. To change it, define an Unseen-Sequence entry in your profile. It may also contain multiple sequence names, separated by spaces β and in that case, anything that applied to a single unseen sequence applies to multiple ones too.
The unseen sequence mechanism is automatically activated. To deactivate it, define the Unseen-Sequence entry in your profile with an empty value.
π FILES π
$HOME/.mmh/profileβ The user profile$HOME/.mmh/contextβ The user context<folder>/.mh_sequencesβ File for public sequences
π PROFILE COMPONENTS π
Mh-Sequences:β Name of file to store public sequencesSequence-Negation:β To designate messages not in a sequencePrevious-Sequence:β The last message specification givenUnseen-Sequence:β Those messages not yet seen by the user
π SEE ALSO π
flist(1), mark(1), pick(1), mh-profile(5)
π DEFAULTS π
None
π ok that's the whole page bestie, go forth and sequence. this has been mh-sequence(7) from mmh-0.4 β the MH.6.8 edition, dated 2019-01-06. muah, bye! π«Άπ
π¦ where this page comes from
- alpine 3.24: mmh-doc 0.4-r3 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms