MH-SEQUENCE(5) Headers, Tables, and Macros MH-SEQUENCE(5)
NAME
mh-sequence - sequence specification for MH message system
SYNOPSIS
most MH commands
DESCRIPTION
Most MH commands accept a `msg' or `msgs' specification,
where `msg' indicates one message and `msgs' indicates one
or more messages. To designate a message, you may use
either its number (e.g., 1, 10, 234) or one of these
"reserved" message names:
Name Description
first the first message in the folder
last the last message in the folder
cur the most recently accessed message
prev the message numerically preceding "cur"
next the message numerically following "cur"
In commands that take a `msg' argument, the default is
"cur". As a shorthand, "." is equivalent to "cur".
For example: In a folder containing five messages numbered
5, 10, 94, 177 and 325, "first" is 5 and "last" is 325. If
"cur" is 94, then "prev" is 10 and "next" is 177.
The word `msgs' indicates that one or more messages may be
specified. Such a specification consists of one message
designation or of several message designations separated by
spaces. A message designation consists either of a message
name as defined above, or a message range.
A message range is specified as "name1-name2" or "name:n",
where `name', `name1' and `name2' are message names, and `n'
is an integer.
The specification "name1-name2" designates all currently-
existing messages from `name1' to `name2' inclusive. The
message name "all" is a shorthand for the message range
"first-last".
The specification "name:n" designates up to `n' messages.
These messages start with `name' if `name' is a message
number or one of the reserved names "first" "cur", or
"next", The messages end with `name' if `name' is "prev" or
"last". The interpretation of `n' may be overridden by
preceding `n' with a plus or minus sign; `+n' always means
up to `n' messages starting with `name', and ` - n' always
means up to `n' messages ending with `name'.
In commands which accept a `msgs' argument, the default is
[mh.6] Last change: MH.6.8 1
MH-SEQUENCE(5) Headers, Tables, and Macros MH-SEQUENCE(5)
either "cur" or "all", depending on which makes more sense
for each command (see the individual man pages for details).
Repeated specifications of the same message have the same
effect as a single specification of the message.
User-Defined Message Sequences
In addition to the "reserved" (pre-defined) message names
given above, MH supports user-defined sequence names.
User-defined sequences allow the MH user a tremendous amount
of power in dealing with groups of messages in the same
folder by allowing the user to bind a group of messages to a
meaningful symbolic name.
The name used to denote a message sequence must consist of
an alphabetic character followed by zero or more
alphanumeric characters, and can not be one of the
"reserved" message names above. After defining a sequence,
it can be used wherever an MH command expects a `msg' or
`msgs' argument.
Some forms of message ranges are allowed with user-defined
sequences. The specification "name:n" may be used, and it
designates up to the first `n' messages (or last `n' mes-
sages for ` - n') which are elements of the user-defined
sequence `name'.
The specifications "name:next" and "name:prev" may also be
used, and they designate the next or previous message (rela-
tive to the current message) which is an element of the
user-defined sequence `name'. The specificaitions
"name:first" and "name:last" are equivalent to "name:1" and
"name: - 1", respectively. The specification "name:cur" is
not allowed (use just "cur" instead). The syntax of these
message range specifcations is subject to change in the
future.
User-defined sequence names are specific to each folder.
They are defined using the pick and mark commands.
Public and Private User-Defined Sequences
There are two varieties of sequences: public sequences and
private sequences. Public sequences of a folder are acces-
sible to any MH user that can read that folder and are kept
in the .mh_sequences file in the folder. Private sequences
are accessible only to the MH user that defined those
sequences and are kept in the user's MH context file. By
default, pick and mark create public sequences if the folder
for which the sequences are being defined is writable by the
MH user. Otherwise, private sequences are created. This
can be overridden with the `-public' and `-private' switches
[mh.6] Last change: MH.6.8 2
MH-SEQUENCE(5) Headers, Tables, and Macros MH-SEQUENCE(5)
to mark.
Sequence Negation
MH provides the ability to select all messages not elements
of a user-defined sequence. To do this, the user should
define the entry "Sequence-Negation" in the MH profile file;
its value may be any string. This string is then used to
preface an existing user-defined sequence name. This
specification then refers to those messages not elements of
the specified sequence name. For example, if the profile
entry is:
Sequence-Negation: not
then anytime an MH command is given "notfoo" as a `msg' or
`msgs' argument, it would substitute all messages that are
not elements of the sequence "foo".
Obviously, the user should beware of defining sequences with
names that begin with the value of the "Sequence-Negation"
profile entry.
The Previous Sequence
MH provides the ability to remember the `msgs' or `msg'
argument last given to an MH command. The entry "Previous-
Sequence" should be defined in the MH profile; its value
should be a sequence name or multiple sequence names
separated by spaces. If this entry is defined, when when an
MH command finishes, it will define the sequence(s) named in
the value of this entry to be those messages that were
specified to the command. Hence, a profile entry of
Previous-Sequence: pseq
directs any MH command that accepts a `msg' or `msgs' argu-
ment to define the sequence "pseq" as those messages when it
finishes.
Note: there can be a performance penalty in using the "Pre-
vious - Sequence" facility. If it is used, all MH programs
have to write the sequence information to the .mh_ sequences
file for the folder each time they run. If the "Previous-
Sequence" profile entry is not included, only pick and mark
will write to the .mh_sequences file.
The Unseen Sequence
Finally, some users like to indicate messages which have not
been previously seen by them. Both inc and show honor the
profile entry "Unseen-Sequence" to support this activity.
[mh.6] Last change: MH.6.8 3
MH-SEQUENCE(5) Headers, Tables, and Macros MH-SEQUENCE(5)
This entry in the .mh_profile should be defined as one or
more sequence names separated by spaces. If there is a
value for "Unseen -Sequence" in the profile, then whenever
inc places new messages in a folder, the new messages will
also be added to the sequence(s) named in the value of this
entry. Hence, a profile entry of
Unseen-Sequence: unseen
directs inc to add new messages to the sequence "unseen".
Unlike the behavior of the "Previous-Sequence" entry in the
profile, however, the sequence(s) will not be zeroed by inc.
Similarly, whenever show (or next or prev) displays a mes-
sage, that message will be removed from any sequences named
by the "Unseen-Sequence" entry in the profile.
FILES
$HOME/.mh_profile The user profile
<mh-dir>/context The user context
<folder>/.mh_sequences Public sequences for <folder>
PROFILE COMPONENTS
Sequence-Negation: To designate messages not in a sequence
Previous-Sequence: The last message specification given
Unseen-Sequence: Those messages not yet seen by the user
SEE ALSO
mh(1), mark(1), pick(1), mh-profile(5)
DEFAULTS
None
CONTEXT
All
BUGS
User-defined sequences are stored in the .mh_sequences file
as a series of message specifications separated by spaces.
If a user-defined sequence contains too many individual mes-
sage specifications, that line in the file may become too
long for MH to handle. This will generate the error message
".mh _ sequences is poorly formatted". You'll have to edit
the file by hand to remove the offending line.
This can happen to users who define the "Previous- Sequence"
entry in the MH profile and have a folder containing many
messages with gaps in the numbering. A workaround for large
folders is to minimize numbering gaps by using "folder -
pack" often.
[mh.6] Last change: MH.6.8 4