Copied atexit() code from fakesmtp.c to fakepop.c so that its
[mmh] / man / folder.man
1 .TH FOLDER %manext1% "January 1, 2001" "%nmhversion%"
2 .\"
3 .\" %nmhwarning%
4 .\"
5 .SH NAME
6 folder, folders \- set/list current folder/message
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B folder
11 .RI [ +folder ]
12 .RI [ msg ]
13 .RB [ \-all " | " \-noall ]
14 .RB [ \-create " | " \-nocreate ]
15 .RB [ \-fast " | " \-nofast ]
16 .RB [ \-header " | " \-noheader ]
17 .RB [ \-recurse " | " \-norecurse ]
18 .RB [ \-total " | " \-nototal ]
19 .RB [ \-list " | " \-nolist ]
20 .RB [ \-push " | " \-pop ]
21 .RB [ \-pack " | " \-nopack ]
22 .RB [ \-print ]
23 .RB [ \-verbose " | " \-noverbose ]
24 .RB [ \-version ]
25 .RB [ \-help ]
26 .PP
27 .HP 5
28 .B folders
29 is equivalent to
30 .B folder
31 .B \-all
32 .ad
33 .SH DESCRIPTION
34 Since the
35 .B nmh
36 environment is the shell, it is easy to lose track
37 of the current folder from day to day.  When
38 .B folder
39 is given the
40 .B \-print
41 switch (the default),
42 .B folder
43 will list the current folder,
44 the number of messages in it, the range of the messages (low\-high),
45 and the current message within the folder, and will flag extra files if
46 they exist.  An example of this summary is:
47 .PP
48 .RS 5
49 .nf
50 .ta \w'/rnd/phyl/Mail/EP 'u +\w'has ddd messages 'u +\w'(ddd\-ddd); 'u
51 inbox+  has \016 messages       (\0\03\-\022);  cur=\0\05.
52 .fi
53 .RE
54 .PP
55 If a
56 .I +folder
57 and/or
58 .I msg
59 are specified, they will become the current
60 folder and/or message.  By comparison, when a
61 .I +folder
62 argument is given, this corresponds to a \*(lqcd\*(rq operation
63 in the shell; when no
64 .I +folder
65 argument is given, this corresponds roughly to a \*(lqpwd\*(rq
66 operation in the shell.
67 .PP
68 If the specified (or default) folder doesn't exist, the default action
69 is to query the user as to whether the folder should be created; when
70 standard input is not a tty, the answer to the query is assumed to be
71 \*(lqyes\*(rq.
72 .PP
73 Specifying
74 .B \-create
75 will cause
76 .B folder
77 to create new folders
78 without any query.  (This is the easy way to create an empty folder for
79 use later.)  Specifying
80 .B \-nocreate
81 will cause
82 .B folder
83 to exit
84 without creating a non-existant folder.
85 .\"
86 .\" note - this doesn't work at present
87 .\" If `\-noprint' is specified, 
88 .\" a `+folder' and/or `msg' may still be specified
89 .\" to set the current folder and/or message,
90 .\" but the folder summary will not be printed..SS "Multiple Folders"
91 Specifying
92 .B \-all
93 will produce a summary line for each top-level folder
94 in the user's nmh directory, sorted alphabetically.  (If
95 .B folder
96 is invoked by a name ending with \*(lqs\*(rq (e.g.
97 .BR folders ),
98 .B \-all
99 is assumed).  Specifying
100 .B \-recurse
101 with
102 .B \-all
103 will also
104 produce a line for all sub-folders.  These folders are all preceded by
105 the read\-only folders, which occur as
106 .RI \*(lq atr\-cur\- \*(rq
107 entries in the user's
108 .B nmh
109 context.  For example:
110 .PP
111 .RS 5
112 .nf
113 .ta \w'/rnd/phyl/Mail/EP 'u +\w'has ddd messages 'u +\w'(ddd\-ddd); 'u
114 FOLDER  \0\0\0\0\0\0# MESSAGES  RANGE   CUR     (OTHERS)
115 /var/work/folder        has \035 messages       (\01\-\035);    cur=23.
116 /usr/bugs/Mail  has \082 messages       (\01\-108);     cur=82.
117 ff      has \0no messages.
118 inbox+  has \016 messages       (\03\-\022);    cur=\05.
119 mh      has \076 messages       (15\-\076);     cur=70.
120 notes   has \0\02 messages      (\01\-\0\02);   cur=\01.
121 ucom    has 124 messages        (\01\-124);     cur=\06; (others).
122 .ta \w'/rnd/phyl/Mail/EP has 'u
123 TOTAL = 339 messages in 7 folders
124 .fi
125 .RE
126 .PP
127 The \*(lq+\*(rq after
128 .I inbox
129 indicates that it is the current folder.
130 The \*(lq(others)\*(rq indicates that the folder
131 .I ucom
132 has files which
133 aren't messages.  These files may either be sub\-folders, or files that
134 don't belong under the nmh file naming scheme.
135 .PP
136 The header is output if either a
137 .B \-all
138 or a
139 .B \-header
140 switch is specified.  It is suppressed by
141 .BR \-noheader .
142 .PP
143 The folder and message totals are output if either a
144 .B \-all
145 or a
146 .B \-total
147 switch is specified.  It is suppressed by
148 .BR \-nototal .
149 .PP
150 If
151 .B \-fast
152 is given, only the folder name (or names in the case of
153 .BR \-all )
154 will be listed.  (This is faster because the folders need not
155 be read.)
156 .PP
157 If a
158 .I +folder
159 is given along with the
160 .B \-all
161 switch,
162 .B folder
163 will, in addition to setting the current folder, list the top\-level subfolders
164 for the current folder (with
165 .BR \-norecurse )
166 or list all sub-folders under the current folder recursively (with
167 .BR \-recurse ).
168 .PP
169 If
170 .I msg
171 is supplied, together with
172 .IR +folder
173 or without
174 .BR \-all ,
175 it will become the current message of
176 .IR +folder
177 (if it had been supplied)
178 or the current folder.
179 .PP
180 The
181 .B \-recurse
182 switch lists each folder recursively, so use of this
183 option effectively defeats the speed enhancement of the
184 .B \-fast
185 option,
186 since each folder must be searched for subfolders.  Nevertheless, the
187 combination of these options is useful.
188 .PP
189 .SS "Compacting a Folder"
190 The
191 .B \-pack
192 switch will compress the message names in the designated
193 folders, removing holes in message numbering.  The
194 .B \-verbose
195 switch directs
196 .B folder
197 to tell the user the general actions that it is
198 taking to compress the folder.
199 .PP
200 .SS "The Folder Stack"
201 The
202 .B \-push
203 switch directs
204 .B folder
205 to push the current folder
206 onto the
207 .IR folder\-stack ,
208 and make the
209 .I +folder
210 argument the current folder.  If
211 .I +folder
212 is not given, the current folder and the
213 top of the
214 .I folder\-stack
215 are exchanged.  This corresponds to the
216 \*(lqpushd\*(rq operation in the shell.
217 .PP
218 The
219 .B \-pop
220 switch directs
221 .B folder
222 to discard the top of the
223 .IR folder\-stack ,
224 after setting the current folder to that value.
225 No
226 .I +folder
227 argument is allowed.  This corresponds to the \*(lqpopd\*(rq
228 operation in the shell.  The
229 .B \-push
230 switch and the
231 .B \-pop
232 switch
233 are mutually exclusive: the last occurrence of either one overrides
234 any previous occurrence of the other.  Both of these switches also set
235 .B \-list
236 by default.
237 .PP
238 The
239 .B \-list
240 switch directs
241 .B folder
242 to list the contents of
243 the
244 .IR folder\-stack .
245 No
246 .I +folder
247 argument is allowed.  After a successful
248 .B \-push
249 or
250 .BR \-pop ,
251 the
252 .B \-list
253 action is taken, unless a
254 .B \-nolist
255 switch follows them on the command line.  This corresponds
256 to the \*(lqdirs\*(rq operation in the shell.  The
257 .BR \-push ,
258 .BR \-pop ,
259 and
260 .B \-list
261 switches turn off
262 .BR \-print .
263 .SH FILES
264 .fc ^ ~
265 .nf
266 .ta \w'%etcdir%/ExtraBigFileName  'u
267 ^$HOME/\&.mh\(ruprofile~^The user profile
268 .fi
269 .SH "PROFILE COMPONENTS"
270 .fc ^ ~
271 .nf
272 .ta 2.4i
273 .ta \w'ExtraBigProfileName  'u
274 ^Path:~^To determine the user's nmh directory
275 ^Current\-Folder:~^To find the default current folder
276 ^Folder\-Protect:~^To set mode when creating a new folder
277 ^Folder\-Stack:~^To determine the folder stack
278 .\" ^lsproc:~^Program to list the contents of a folder
279 .fi
280 .SH "SEE ALSO"
281 .IR mhpath (1),
282 .IR refile (1)
283 .SH DEFAULTS
284 .nf
285 .RB ` +folder "' defaults to the current folder"
286 .RB ` msg "' defaults to none"
287 .RB ` \-nofast '
288 .RB ` \-noheader '
289 .RB ` \-nototal '
290 .RB ` \-nopack '
291 .RB ` \-norecurse '
292 .RB ` \-noverbose '
293 .RB ` \-print "' is the default if no " \-list ", " \-push ", or " \-pop " is specified"
294 .RB ` \-list "' is the default if " \-push ", or " \-pop " is specified"
295 .fi
296 .SH CONTEXT
297 If
298 .I +folder
299 and/or
300 .I msg
301 are given, they will become the current folder and/or message.
302 .SH BUGS
303 There is no way to restore the default behavior 
304 (to ask the user whether to create a non-existant folder)
305 after
306 .B \-create
307 or
308 .B \-nocreate
309 is given.