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