1 02/20/86  Message specifiers
  2 
  3 Most read_mail requests are capable of processing several messages in
  4 one invocation.  The messages which a request is to process are
  5 identified by one or more message specifiers.
  6 
  7 
  8 Selecting deleted messages:
  9 Message specifiers normally refer only to the messages in a mailbox
 10 which have not been marked for deletion.  Most requests accept the
 11 following control arguments to modify the set of messages which are
 12 available for selection by the request's message specifiers:
 13 
 14 
 15 -include_deleted, -idl
 16    includes all messages in the mailbox whether or not they have been
 17    deleted when interpreting any message specifiers to determine which
 18    messages to process.
 19 -only_deleted, -odl
 20    includes only those messages which have been deleted.
 21 -only_non_deleted, -ondl
 22    includes only those messages which have not been deleted.  (Default)
 23 
 24 If a message specifier identifies a range of messages (see below), at
 25 least one message in that range must be of the appropriate type as
 26 determined by the above control arguments.
 27 
 28 
 29 Single message specifiers:
 30 The simplest form of a message specifier is simply a message number
 31 (eg: 3).  Message numbers are assigned by read_mail when it first reads
 32 the mailbox.  Message numbers do not change during the invocation even
 33 if messages are deleted.  The following keywords can be used to refer
 34 to individual messages without having to know their message number:
 35 
 36 
 37 first, f
 38    identifies the first message of the appropriate type in the mailbox.
 39    (Ie: the first message (#1) if -idl is given, the first deleted
 40    message if -odl is given, or the first non-deleted message if -ondl
 41    or none of these control arguments is given).
 42 last, l
 43    identifies the last message of the appropriate type in the mailbox.
 44 next, n
 45    identifies the next message of the appropriate type in the mailbox.
 46 previous, p
 47    identifies the previous message of the appropriate type in the
 48    mailbox.
 49 
 50 
 51 current, c, .
 52    refers to the current message.  The current message is initially the
 53    first message in the mailbox.  Most requests set the current message
 54    to the last message processed by the request.  For example, after
 55    executing the request:
 56          print 4 12
 57    the current message will be message #12.
 58 
 59 
 60 first_seen, fs
 61    refers to the first undeleted "seen" message (see "seen" below).
 62 first_unseen, fu
 63    refers to the first undeleted "unseen" message (see "unseen" below).
 64 last_seen
 65    refers to the last undeleted "seen" message.
 66 last_unseen, lu
 67    refers to the last undeleted "unseen" message.
 68 next_seen, ns
 69    refers to the next undeleted "seen" message.
 70 next_unseen, nu
 71    refers to the next undeleted "unseen" message.
 72 previous_seen, ps
 73    refers to the previous undeleted "seen" message.
 74 previous_unseen, pu
 75    refers to the previous undeleted "unseen" message.
 76 
 77 
 78 Ranges of messages:
 79 Ranges of messages can be identified by using two message numbers or
 80 keywords separated by a colon (:).  For example,
 81 
 82       3:last
 83 
 84 identifies all messages of the appropriate type from message #3 through
 85 the last message of the appropriate type in the mailbox.
 86 
 87 The keyword "all" is accepted as shorthand for "first:last" and
 88 identifies all messages of the appropriate type in the mailbox.
 89 
 90 
 91 Other keywords:
 92 The following keywords specify collections of messages -
 93 
 94 all
 95    refers to all messages of the appropriate type in the mailbox.
 96    It is shorthand for "first:last".
 97 unseen
 98    refers to all messages of the appropriate type that have not yet
 99    been printed by the print request, by a user having "d" extended
100    access to the mailbox.
101 seen
102    refers to all messages of the appropriate type that have previously
103    been printed by the print request, by a user having "d" extended
104    accesss to the mailbox. These, when listed, have an "S" preceding
105    the sender name.
106 new
107    refers to all messages of the appropriate type after the last
108    "seen" message, that is, after the latest one that was printed
109    previously by the print request, by a user having "d" extended
110    access to the mailbox.
111 
112 Arithmetic:
113 Message numbers can be added and subtracted using "+" and "-".  For
114 example, if the current message is #20,
115 
116       current-5:current+10
117 
118 identifies all messages of the appropriate type from message #15
119 through #30.  As this example demonstrates, arithmetic operations are
120 performed after any message keywords are converted to absolute numbers.
121 In other words, "current+2" does not mean the second message of the
122 appropriate type after the current message.
123 
124 
125 Regular expressions:
126 Qedx regular expressions can be used to select all messages of the
127 appropriate type in the mailbox which contain a given string.  The
128 regular expression must be enclosed in slashes (/); for an explanation
129 of the syntax of regular expressions, see the Qedx Text Editor's User
130 Guide, order number CG40.  If the regular expression contains spaces,
131 horizontal tabs, quotes ("), parentheses, or brackets, the entire
132 expression must be enclosed in quotes to avoid misinterpretation by the
133 request line processor; any quotes within the regular expression must
134 be doubled.  For example,
135 
136       "/said, ""I think/"
137 
138 matches any message which contains the string
139 
140       said, "I think
141 
142 
143 A regular expression can be preceded by any of the keywords:
144 
145           first, last, next, previous, all
146 
147 to select the first, last, etc.  message containing that string.
148 Additionally, two or more regular expressions can be combined by
149 connectors for logical and (&) and logical or (|).  For example,
150 
151       last/artificial/&/intelligence/
152 
153 specifies the last message of the appropriate type containing both of
154 the strings "artificial" and "intelligence".
155 
156 
157 Examples:
158 In the following examples, assume that -only_non_deleted is specified
159 and that the current message is #15, the first non-deleted message
160 after the current message is #17, the last non-deleted message before
161 the current message is #10, the first non-deleted message is #3, and
162 the last non-deleted message is #23.
163 
164 
165 1  would select message #1.  However, as -ondl is specified and the
166    first non-deleted message is message #3, this specifier would
167    generate an error.
168 
169 1:3
170    selects all non-deleted messages from message #1 to #3 inclusive
171    (ie: #3).
172 
173 /foo/
174    selects all non-deleted messages containing the string "foo".
175 
176 last-3
177    selects message #20.
178 
179 
180 l-3:l
181    selects all non-deleted messages in the range from #20 to #23 (the
182    last non-deleted message).
183 
184 next+4
185    selects message #21.
186 
187 p-2
188    selects message #8.
189 
190 c:c+4
191    selects all non-deleted messages in the range from #15 (the current
192    message) to #19.
193 
194 
195 /frogs/|/propellent/
196    selects all non-deleted messages containing either of the strings
197    "frogs" or "propellent".
198 
199 "l/ it /"
200    selects the last non-deleted message containing the string " it ".
201    This specifier is enclosed in quotes because it contains spaces
202    which have special significance to the request processor.