MH−SEQUENCE(5) — NEWS-OS Programmer’s Manual
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:
NameDescription
firstthe first message in the folder
lastthe last message in the folder
curthe most recently accessed message
prevthe message numerically preceding “cur”
nextthe 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 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.
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’ messages 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 (relative 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.
There are two varieties of sequences: public sequences and private sequences. Public sequences of a folder are accessible 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 to mark.
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.
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’ argument to define the sequence “pseq” as those messages when it finishes.
Note: there can be a performance penalty in using the “Previous−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.
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. 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 message, that message will be removed from any sequences named by the “Unseen−Sequence” entry in the profile.
^$HOME/.mh_profile~^The user profile ^<mh−dir>/context~^The user context ^<folder>/.mh_sequences~^Public sequences for <folder> ^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 mh(1), mark(1), pick(1), mh-profile(5) None All 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 message 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.
NEWS-OS Release 4.2.1R