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