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