Update the man pages to the shortened reserved sequence names
[mmh] / man / mh-sequence.man7
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH MH-SEQUENCE %manext7% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 mh-sequence \- sequence specification for nmh message system
7 .SH SYNOPSIS
8 most
9 .B nmh
10 commands
11 .SH DESCRIPTION
12 A sequence (or sequence set) is a symbolic name representing a
13 message or collection of messages.
14 .B nmh
15 has several internally
16 defined sequences, as well as allowing users to define their own
17 sequences.
18
19 .SS "Message Specification and Pre\-Defined Message Sequences"
20 Most
21 .B nmh
22 commands accept a `msg' or `msgs' specification, where
23 `msg' indicates one message and `msgs' indicates one or more messages.
24 To designate a message, you may use either its number (e.g., 1, 10, 234)
25 or one of these `reserved' message names:
26 .PP
27 .RS 5
28 .nf
29 .ta +\w'\fIName\fP      'u
30 .I "Name        Description
31 f       the first message in the folder
32 p       the message numerically preceding `c'
33 c       the most recently accessed message
34 n       the message numerically following `c'
35 l       the last message in the folder
36 .fi
37 .RE
38 .PP
39 In commands that take a `msg' argument, the default is `c'.
40 .PP
41 For example: In a folder containing five messages numbered 5, 10, 94, 177
42 and 325, `f' is 5 and `l' is 325.  If `c'
43 is 94, then `p' is 10 and `n' is 177.
44 .PP
45 The word `msgs' indicates that one or more messages may be specified.
46 Such a specification consists of one message designation or of several
47 message designations separated by spaces.  A message designation consists
48 either of a message name as defined above, or a message range.
49 .PP
50 A message range is specified as `name1\-name2' or
51 `name:i', where `name', `name1' and `name2' are message names,
52 and `i' is an integer.
53 .PP
54 The specification `name1\-name2' designates all currently existing
55 messages from `name1' to `name2' inclusive.  The `reserved'
56 message name `a' (``all'') is a shorthand for the message range
57 `f\-l'.
58 .PP
59 .RS 5
60 .nf
61 .ta +\w'\fIName\fP      'u
62 .I "Name        Description
63 a       all messages in the folder (i.e. `f\-l')
64 .fi
65 .RE
66 .PP
67 The specification `name:i' designates up to `i' messages.
68 These messages start with `name' if `name' is a message number or one of
69 the reserved names `f' `c', or `n', The
70 messages end with `name' if `name' is `p' or `l'.
71 The interpretation of `i' may be overridden by preceding `i' with a
72 plus or minus sign; `+i' always means up to `i' messages starting with
73 `name', and `\-i' always means up to `i' messages ending with `name'.
74 .PP
75 In commands which accept a `msgs' argument, the default is either
76 `c' or `a', depending on which makes more sense
77 for each command (see the individual man pages for details).
78 .PP
79 Repeated
80 specifications of the same message have the same effect as a single
81 specification of the message.
82 .PP
83 There is also a special `reserved' message name `b' (``beyond'')
84 which can be used with the
85 .B mhpath
86 command. It refers to the next (not yet used) message number 
87 after `l'.
88 .PP
89 .RS 5
90 .nf
91 .ta +\w'\fIName\fP      'u
92 .I "Name        Description
93 b       the next message number beyond `l'
94 .fi
95 .RE
96
97 .SS "User\-Defined Message Sequences"
98 In addition to the `reserved' (pre-defined) message names given
99 above,
100 .B nmh
101 supports user-defined sequence names.  User-defined
102 sequences allow the
103 .B nmh
104 user a tremendous amount of power in dealing
105 with groups of messages in the same folder by allowing the user to bind
106 a group of messages to a meaningful symbolic name.
107 .PP
108 The name used to denote a message sequence must consist of an alphabetic
109 character followed by zero or more alphanumeric characters, and can not
110 be one of the `reserved' message names above.  After defining a
111 sequence, it can be used wherever an
112 .B nmh
113 command expects a `msg' or
114 `msgs' argument.
115 .PP
116 Some forms of message ranges are allowed with user-defined sequences.
117 The specification `name:i' may be used, and it designates up
118 to the first `i' messages (or last `i' messages for `\-i') which are
119 elements of the user-defined sequence `name'.
120 .PP
121 The specifications `name:n' and `name:p' may also
122 be used, and they designate the next or previous message (relative to the
123 current message) which is an element of the user-defined sequence `name'.
124 The specifications `name:f' and `name:l' are
125 equivalent to `name:1' and `name:\-1', respectively.  The
126 specification `name:c' is not allowed (use just `c' instead).
127 Note: The syntax of these message range specifications is subject
128 to change in the future.
129 .PP
130 User-defined sequence names are specific to each folder.  They are
131 defined using the
132 .B pick
133 and
134 .B mark
135 commands.
136
137 .SS "Public and Private User-Defined Sequences"
138 There are two varieties of user-defined sequences:
139 public and private.  Public sequences of a folder are accessible to any
140 .B nmh
141 user that can read that folder.  They are kept in each folder
142 in the file determined by the `Mh\-Sequences' profile entry
143 (default is
144 .IR \&.mh_sequences ).
145 Private sequences are accessible
146 only to the
147 .B nmh
148 user that defined those sequences and are kept in
149 the user's
150 .B nmh
151 context file.
152 .PP
153 In general, the commands that create sequences (such as
154 .B pick
155 and
156 .BR mark )
157 will create public sequences if the folder for which
158 the sequences are being defined is writable by the
159 .B nmh
160 user.
161 For most commands, this can be overridden by using the switches
162 .B \-public
163 and
164 .BR \-private .
165 But if the folder is read\-only, or if
166 the `Mh\-Sequences' profile entry is defined but empty, then
167 \fIprivate\fR sequences will be created instead.
168
169 .SS "Sequence Negation"
170 .B Nmh
171 provides the ability to select all messages
172 .B not
173 elements of a user-defined sequence.
174 A special string is used to preface an existing user-defined
175 sequence name.  This specification then refers to those
176 messages not elements of the specified sequence name.
177 The default negation prefix is the exlamation mark `!',
178 but it may be change to any string, by defining the entry
179 `Sequence\-Negation' in the
180 .B nmh
181 profile file.
182 For example, if the profile entry is:
183 .PP
184 .RS 5
185 Sequence\-Negation: not
186 .RE
187 .PP
188 then anytime an
189 .B nmh
190 command is given `notfoo' as a `msg' or
191 `msgs' argument, it would substitute all messages that are not elements
192 of the sequence `foo'.
193 .PP
194 Obviously, the user should beware of defining sequences with names that
195 begin with the value of the `Sequence\-Negation' profile entry.
196 The default value `!' was chosen due to its similar meaning in the C
197 programming language, and because it cannot be part of a user-defined
198 sequence. But if your shell provides history expansion,
199 you might need to quote the exlamation mark (prefix it with a backslash).
200 .PP
201 To deactivate the negation mechanism, define Sequence\-Negation in your
202 profile to an empty value.
203
204 .SS "The Previous Sequence"
205 .B Nmh
206 provides the ability to remember the `msgs' or `msg' argument
207 last given to an
208 .B nmh
209 command.  The entry `Previous\-Sequence'
210 should be defined in the
211 .B nmh
212 profile; its value should be a sequence
213 name or multiple sequence names separated by spaces.  If this entry
214 is defined, when an
215 .B nmh
216 command finishes, it will define the
217 sequence(s) named in the value of this entry to be those messages that
218 were specified to the command.  Hence, a profile entry of
219 .PP
220 .RS 5
221 Previous\-Sequence: pseq
222 .RE
223 .PP
224 directs any
225 .B nmh
226 command that accepts a `msg' or `msgs' argument to
227 define the sequence `pseq' as those messages when it finishes.
228 .PP
229 .BR Note :
230 there can be a performance penalty in using the
231 `Previous\-Sequence' facility.  If it is used,
232 .B all
233 .B nmh
234 programs have to write the sequence information to the
235 .I \&.mh_sequences
236 file for the folder each time they run.  If the
237 `Previous\-Sequence' profile entry is not included, only
238 .B pick
239 and
240 .B mark
241 will write to the
242 .B \&.mh_sequences
243 file.
244
245 .SS "The Unseen Sequence"
246 Finally, the unseen sequence indicates which messages have not been
247 previously seen by the user.
248 The commands
249 .BR inc ,
250 .BR rcvstore ,
251 .BR show ,
252 and
253 .B flist
254 honor the sequence.
255 Whenever new messages are placed in a folder (using
256 .B inc
257 or
258 .BR rcvstore ),
259 the new messages will also be added to the unseen sequence.
260 .RE
261 .PP
262 .BR inc ,
263 for example,
264 adds new messages to the unseen sequence.
265 Unlike the behavior of the previous sequence, however,
266 the unseen sequence will
267 .B not
268 be zeroed by
269 .BR inc .
270 .PP
271 Similarly, whenever
272 .BR show ,
273 .BR next ,
274 or
275 .B prev
276 display a message, that message will be removed from
277 the unseen sequence.
278 .PP
279 The default unseen sequence is named `u'.
280 To change, define a `Unseen\-Sequence' entry in your profile.
281 It may also contain multiple sequence names, separated by spaces.
282 In this case, anything that applied to a single unseen sequence,
283 applies to multiple ones, too.
284 .PP
285 The unseen sequence mechanism is automatically activated.
286 To deactivate it, define the `Unseen\-Sequence' entry
287 in your profile with an empty value.
288
289
290 .SH FILES
291 .fc ^ ~
292 .nf
293 .ta \w'%etcdir%/ExtraBigFileName  'u
294 ^$HOME/.mmh/profile~^The user profile
295 ^$HOME/.mmh/context~^The user context
296 ^<folder>/\&.mh_sequences~^File for public sequences
297 .fi
298
299 .SH "PROFILE COMPONENTS"
300 .fc ^ ~
301 .nf
302 .ta 2.4i
303 .ta \w'ExtraBigProfileName  'u
304 ^Mh-Sequences:~^Name of file to store public sequences
305 ^Sequence\-Negation:~^To designate messages not in a sequence
306 ^Previous\-Sequence:~^The last message specification given
307 ^Unseen\-Sequence:~^Those messages not yet seen by the user
308 .fi
309
310 .SH "SEE ALSO"
311 flist(1), mark(1), pick(1), mh-profile(5)
312
313 .SH DEFAULTS
314 None