Removed the -header option from scan(1).
[mmh] / man / scan.man1
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH SCAN %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 scan \- produce a one line per message scan listing
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B scan
11 .RI [ +folder ]
12 .RI [ msgs ]
13 .RB [ \-clear " | " \-noclear ]
14 .RB [ \-form
15 .IR formatfile ]
16 .RB [ \-format
17 .IR string ]
18 .RB [ \-width
19 .IR columns ]
20 .RB [ \-reverse " | " \-noreverse ]
21 .RB [ \-file
22 .IR filename ]
23 .RB [ \-version ]
24 .RB [ \-help ]
25 .ad
26 .SH DESCRIPTION
27 .B Scan
28 produces a one\-line\-per\-message listing of the specified
29 folder or messages.  Each
30 .B scan
31 line contains the message number
32 (name), the date, the \*(lqFrom:\*(rq field, the \*(lqSubject\*(rq field,
33 and, if room allows, some of the body of the message.  For example:
34 .PP
35 .RS 5
36 .nf
37 .ta \w'15+- 'u +\w'07/\|05x 'u +\w'Dcrocker  'u
38 15+     10/\|05 crocker nned\0\0<<Last week I asked some of
39 16\-    10/\|05 crocker message id format\0\0\<<I recommend
40 18      10/\|06 brien   Re: Exit status from mkdir
41 19      10/\|07*brien   \*(lqscan\*(rq listing format in nmh
42 .fi
43 .RE
44 .PP
45 The `+' on message 15 indicates that it is the current message.
46 .PP
47 The `\-' on message 16 indicates that it has been replied to, as indicated
48 by a \*(lqReplied:\*(rq component (produced by the
49 .B \-annotate
50 switch
51 to the
52 .B repl
53 command).
54 .PP
55 The `*' on message 19 indicates that no \*(lqDate:\*(rq header was
56 present.  The time of last modification of the message is given instead.
57 .PP
58 If there is sufficient room left on the
59 .B scan
60 line after the
61 subject, the line will be filled with text from the body, preceded by
62 \*(lq<<\*(rq, and terminated by \*(lq>>\*(rq if the body is sufficiently short.
63 .B Scan
64 actually reads each of the specified messages and parses them to extract
65 the desired fields.  During parsing, appropriate error messages will be
66 produced if there are format errors in any of the messages.
67 .PP
68 By default,
69 .B scan
70 will decode RFC-2047 (MIME) encoding in
71 these scan listings.
72 .B Scan
73 will only decode these fields if your
74 terminal can natively display the character set used in the encoding.
75 You should set the MM_CHARSET environment variable to your native
76 character set, if it is not US-ASCII.  See the mh-profile(5) man
77 page for details about this environment variable.
78 .PP
79 The switch
80 .BR \-reverse ,
81 makes
82 .B scan
83 list the messages in reverse
84 order.
85 .PP
86 The
87 .B \-file
88 .I filename
89 switch allows the user to obtain a
90 .B scan
91 listing of a maildrop file as produced by
92 .BR packf .
93 This listing
94 includes every message in the file (you can't scan individual messages).
95 The switch
96 .B \-reverse
97 is ignored with this option.
98 .PP
99 The switch
100 .B \-width
101 .I columns
102 may be used to specify the width of
103 the scan line.  The default is to use the width of the terminal.
104 .PP
105 If the
106 .B \-clear
107 switch is used and
108 .BR scan 's
109 output is directed
110 to a terminal, then
111 .B scan
112 will consult the environment variables
113 .B $TERM
114 and
115 .B $TERMCAP
116 to determine your terminal type in order
117 to find out how to clear the screen prior to exiting.  If the
118 .B \-clear
119 switch is used and
120 .BR scan 's
121 output is not directed to a terminal
122 (e.g., a pipe or a file), then
123 .B scan
124 will send a formfeed prior
125 to exiting.
126 .PP
127 For example, the command:
128 .PP
129 .RS 5
130 (scan \-clear ; show all \-show pr \-f) | lpr
131 .RE
132 .PP
133 produces a scan listing of the current folder, followed by a formfeed,
134 followed by a formatted listing of all messages in the folder, one
135 per page.  Omitting
136 .RB \*(lq "\-show\ pr\ \-f" \*(rq
137 will cause the messages to be
138 concatenated, separated by a one\-line header and two blank lines.
139 .PP
140 To override the output format used by
141 .BR scan ,
142 the
143 .B \-format
144 .I string
145 or
146 .B \-form
147 .I file
148 switches are used.  This permits individual fields of
149 the scan listing to be extracted with ease.  The string is simply a format
150 string and the file is simply a format file.  See
151 .BR mh\-format (5)
152 for the details.
153 .PP
154 In addition to the standard
155 .BR mh\-format (5)
156 escapes,
157 .B scan
158 also recognizes the following additional
159 .I component
160 escapes:
161 .PP
162 .RS 5
163 .nf
164 .ta \w'Dtimenow  'u +\w'Returns  'u
165 .I Escape       Returns Description
166 body    string  the (compressed) first part of the body
167 dtimenow        date    the current date
168 folder  string  the name of the current folder
169 .fi
170 .RE
171 .PP
172 If no date header is present in the message, the
173 .I function
174 escapes
175 which operate on
176 .RB { date }
177 will return values for the date of last
178 modification of the message file itself.  This feature is handy for
179 scanning a draft folder, as message drafts usually aren't allowed
180 to have dates in them.
181 .PP
182 .B scan
183 will update the
184 .B mmh
185 context prior to starting the listing,
186 so interrupting a long
187 .B scan
188 listing preserves the new context.
189 .B nmh
190 purists hate this idea.
191
192 .SH FILES
193 .fc ^ ~
194 .nf
195 .ta \w'%etcdir%/ExtraBigFileName  'u
196 ^$HOME/.mmh/profile~^The user profile
197 .fi
198
199 .SH "PROFILE COMPONENTS"
200 .fc ^ ~
201 .nf
202 .ta 2.4i
203 .ta \w'ExtraBigProfileName  'u
204 ^Path:~^To determine the user's mail storage
205 ^Alternate\-Mailboxes:~^To determine the user's mailboxes
206 ^Current\-Folder:~^To find the default current folder
207 .fi
208
209 .SH "SEE ALSO"
210 inc(1), pick(1), show(1), mh\-format(5)
211
212 .SH DEFAULTS
213 .nf
214 .RB ` +folder "' defaults to the current folder"
215 .RB ` msgs "' defaults to all"
216 .RB ` \-format "' defaulted as described above"
217 .RB ` \-width "' defaulted to the width of the terminal"
218 .fi
219
220 .SH CONTEXT
221 If a folder is given, it will become the current folder.
222
223 .SH BUGS
224 The argument to the
225 .B \-format
226 switch must be interpreted as a single
227 token by the shell that invokes
228 .BR scan .
229 Therefore, one must usually
230 place the argument to this switch inside double\-quotes.
231 .PP
232 The value of each
233 .I component
234 escape is set by
235 .B scan
236 to the
237 contents of the first message header
238 .B scan
239 encounters with the
240 corresponding component name; any following headers with the same
241 component name are ignored.