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