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