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