*** empty log message ***
[emacs.git] / man / woman.texi
blobcb77d5c6a1c360eb0dee1f122d730616588304c7
1 \input texinfo   @c -*-texinfo-*-
2 @c $Id: woman.texi,v 1.3 2000/08/09 13:14:26 eliz Exp $
3 @c %**start of header
4 @setfilename ../info/woman
5 @settitle WoMan: Browse UN*X Manual Pages ``Wo (without) Man''
6 @c Manual last updated:
7 @set UPDATED Time-stamp: <2000-08-08 12:20:51 eliz>
8 @c Software version:
9 @set VERSION 0.54 (beta)
10 @afourpaper
11 @c With different size paper the printed page breaks will need attention!
12 @c Look for @page and @need commands.
13 @setchapternewpage off
14 @paragraphindent 0
15 @c %**end of header
17 @dircategory Emacs
18 @direntry
19 * WoMan: (woman).       Browse UN*X Manual Pages `Wo (without) Man'.
20 @end direntry
22 @ifinfo
23 This file documents WoMan: A program to browse UN*X manual pages `wo
24 (without) man'.
26 Copyright @copyright{} 2000  Free Software Foundation, Inc.
28 This manual and the software that it describes are subject to the GNU
29 General Public License that is distributed with GNU Emacs -- see the
30 file @file{COPYING}.
32 Permission is granted to make and distribute verbatim copies of this
33 manual provided the copyright notice and this permission notice are
34 preserved on all copies.
36 @ignore
37 Permission is granted to process this file through TeX and print the
38 results, provided the printed document carries a copying permission
39 notice identical to this one except for the removal of this paragraph
40 (this paragraph not being relevant to the printed manual).
42 @end ignore
43 Permission is granted to copy and distribute modified versions of this
44 manual under the conditions for verbatim copying and provided that the
45 entire resulting derived work is distributed under the terms of a
46 permission notice identical to this one.
48 Permission is granted to copy and distribute translations of this manual
49 into another language, under the above conditions for modified versions.
50 @end ifinfo
52 @finalout
54 @titlepage
55 @title WoMan
56 @subtitle Browse UN*X Manual Pages ``Wo (without) Man''
57 @subtitle Software Version @value{VERSION}
58 @author Francis J. Wright
59 @sp 2
60 @author School of Mathematical Sciences
61 @author Queen Mary and Westfield College
62 @author (University of London)
63 @author Mile End Road, London E1 4NS, UK
64 @author @email{F.J.Wright@@qmw.ac.uk}
65 @author @uref{http://centaur.maths.qmw.ac.uk/}
66 @sp 2
67 @author Manual Last Updated @value{UPDATED}
69 @comment  The following two commands start the copyright page.
70 @page
71 @vskip 0pt plus 1filll
72 Copyright @copyright{} 2000  Francis J. Wright
74 This manual and the software that it describes are subject to the GNU
75 General Public License that is distributed with GNU Emacs -- see the
76 file @file{COPYING}.
78 Permission is granted to make and distribute verbatim copies of this
79 manual provided the copyright notice and this permission notice are
80 preserved on all copies.
82 Permission is granted to copy and distribute modified versions of this
83 manual under the conditions for verbatim copying and provided that the
84 entire resulting derived work is distributed under the terms of a
85 permission notice identical to this one.
87 Permission is granted to copy and distribute translations of this manual
88 into another language, under the above conditions for modified versions.
89 @end titlepage
91 @contents
93 @c ===================================================================
95 @ifnottex
96 @node Top, Introduction, (dir), (dir)
97 @comment  node-name,  next,  previous,  up
98 @top WoMan: Browse UN*X Manual Pages ``Wo (without) Man''
100 @display
101 Software Version @value{VERSION}
102 Manual Last Updated @value{UPDATED}
104 @email{F.J.Wright@@qmw.ac.uk, Francis J. Wright}
105 @uref{http://centaur.maths.qmw.ac.uk/, School of Mathematical Sciences}
106 Queen Mary and Westfield College (University of London)
107 Mile End Road, London E1 4NS, UK
108 @end display
109 @end ifnottex
111 @menu
112 * Introduction::        Introduction
113 * Background::          Background
114 * Installation::        Installation and Setup
115 * Finding::             Finding and Formatting Man Pages
116 * Browsing::            Browsing Man Pages
117 * Customization::       Customization
118 * Log::                 The *WoMan-Log* Buffer
119 * Technical::           Technical Details
120 * Bugs::                Reporting Bugs
121 * Acknowledgements::    Acknowledgements
122 * Command Index::       Command Index
123 * Variable Index::      Variable Index
124 * Keystroke Index::     Keystroke Index
125 * Concept Index::       Concept Index
126 @end menu
128 @c ===================================================================
130 @node Introduction, Background, Top, Top
131 @comment  node-name,  next,  previous,  up
132 @chapter Introduction
133 @cindex introduction
135 This version of WoMan should run with GNU Emacs 20.3 or later on any
136 platform.  It has not been tested, and may not run, with any other
137 version of Emacs.  It was developed primarily on various versions of
138 Microsoft Windows, but has also been tested on MS-DOS, and various
139 versions of UNIX and Linux.
141 WoMan is distributed with GNU Emacs 21, and the current source code and
142 documentation files are available from
143 @uref{http://centaur.maths.qmw.ac.uk/Emacs/WoMan/, my web server}.
145 WoMan implements a subset of the formatting performed by the Emacs
146 @code{man} (or @code{manual-entry}) command to format a UN*X-style
147 @dfn{manual page} (usually abbreviated to @dfn{man page}) for display,
148 but without calling any external programs.  It is intended to emulate
149 the whole of the @code{ROFF -man} macro package, plus those @code{ROFF}
150 requests (@pxref{Background, , Background}) that are most commonly used
151 in man pages.  However, the emulation is modified to include the
152 reformatting done by the Emacs @code{man} command.  No hyphenation is
153 performed.
155 @table @b
156 @item Advantages
157 Much more direct, does not require any external programs.  Supports
158 completion on man page names.
159 @item Disadvantages
160 Not a complete emulation.  Currently no support for @code{eqn} or
161 @code{tbl}.  Slightly slower for large man pages (but usually faster for
162 small- and medium-size pages).
163 @end table
165 This browser works quite well on simple well-written man files.  It
166 works less well on idiosyncratic files that ``break the rules'' or use
167 the more obscure @code{ROFF} requests directly.  Current test results
168 are available in the file
169 @uref{http://centaur.maths.qmw.ac.uk/Emacs/WoMan/woman.status,
170 @file{woman.status}}.
172 WoMan supports the use of compressed man files via
173 @code{auto-compression-mode} by turning it on if necessary.  But you may
174 need to adjust the user option @code{woman-file-compression-regexp}.
175 @xref{Interface Options, , Interface Options}.
177 Brief help on the WoMan interactive commands and user options, all of
178 which begin with the prefix @code{woman-} (or occasionally
179 @code{WoMan-}), is available most easily by loading WoMan and then
180 either running the command @code{woman-mini-help} or selecting the WoMan
181 menu option @samp{Mini Help}.
183 WoMan is (of course) still under development!  Please
184 @email{F.J.Wright@@qmw.ac.uk, let me know} what doesn't work -- I am
185 adding and improving functionality as testing shows that it is
186 necessary.  Guidance on reporting bugs is given below.  @xref{Bugs, ,
187 Reporting Bugs}.
189 @c ===================================================================
191 @node Background, Installation, Introduction, Top
192 @comment  node-name,  next,  previous,  up
193 @chapter Background
194 @cindex background
196 WoMan is a browser for traditional UN*X-style manual page documentation.
197 Each such document is conventionally referred to as a @dfn{manual page},
198 or @dfn{man page} for short, even though some are very much longer than
199 one page.  A man page is a document written using the UN*X ``man''
200 macros, which are themselves written in the NROFF/TROFF text processing
201 markup language.  @code{NROFF} and @code{TROFF} are text processors
202 originally written for the UNIX operating system by Joseph F. Ossanna at
203 Bell Laboratories, Murray Hill, New Jersey, USA@.  They are closely
204 related, and except in the few cases where the distinction between them
205 is important I will refer to them both ambiguously as @dfn{ROFF}.
207 @code{ROFF} markup consists of @dfn{requests} and @dfn{escape
208 sequences}.  A request occupies a complete line and begins with either a
209 period or a single forward quote.  An escape sequences is embedded
210 within the input text and begins (by default) with a backslash.  The
211 original man macro package defines 20 new @code{ROFF} requests
212 implemented as macros, which were considered to be sufficient for
213 writing man pages.  But whilst in principle man pages use only the man
214 macros, in practice a significant number use many other @code{ROFF}
215 requests.
217 The distinction between @code{TROFF} and @code{NROFF} is that
218 @code{TROFF} was designed to drive a phototypesetter whereas
219 @code{NROFF} was designed to produce essentially @sc{ascii} output for a
220 character-based device similar to a teletypewriter (usually abbreviated
221 to ``teletype'' or ``tty'').  Hence, @code{TROFF} supports much finer
222 control over output positioning than does @code{NROFF} and can be seen
223 as a forerunner of @TeX{}.  Traditionally, man pages are either
224 formatted by @code{TROFF} for typesetting or by @code{NROFF} for
225 printing on a character printer or displaying on a screen.  Of course,
226 over the last 25 years or so, the distinction between typeset output on
227 paper and characters on a screen has become blurred by the fact that
228 most screens now support bit-mapped displays, so that any information
229 that can be printed can also be rendered on screen, the only difference
230 being the resolution.
232 Nevertheless, UN*X-style manual page documentation is still normally
233 browsed on screen by running a program called @code{man}.  This program
234 looks in a predefined set of directories for the man page matching a
235 specified topic, then either formats the source file by running
236 @code{NROFF} or recovers a pre-formatted file, and displays it via a
237 pager such as @code{more}.  @code{NROFF} normally formats for a printer,
238 so it paginates the output, numbers the pages, etc., most of which is
239 irrelevant when the document is browsed as a continuous scrollable
240 document on screen.  The only concession to on-screen browsing normally
241 implemented by the @code{man} program is to squeeze consecutive blank
242 lines into a single blank line.
244 For some time, Emacs has offered an improved interface for browsing man
245 pages in the form of the Emacs @code{man} (or @code{manual-entry})
246 command, see @ref{Documentation, man, Documentation Commands, emacs, GNU
247 Emacs Manual}.
248 This command runs @code{man} as described above, perhaps in
249 the background, and then post-processes the output to remove much of the
250 @code{NROFF} pagination such as page headers and footers, and places the
251 result into an Emacs buffer.  It puts this buffer into a special major
252 mode, which is tailored for man page browsing, and provides a number of
253 useful navigation commands, support for following references, etc.  It
254 provides some support for special display faces (fonts), but no special
255 menu or mouse support.  The Emacs man package appears to have been
256 developed over about 10 years, from the late 1980s to the late 1990s.
258 There is considerable inefficiency in having @code{NROFF} paginate a
259 document and then removing most of the pagination!
261 WoMan is an Emacs Lisp library that provides an emulation of the
262 functionality of the Emacs @code{man} command, the main difference being
263 that WoMan does not use any external programs.  The only situation in
264 which WoMan might use an external program is when the source file is
265 compressed, when WoMan will use the standard Emacs automatic
266 decompression facility, which does call an external program.
268 I began developing WoMan in the Spring of 1997 and the first version was
269 released in May 1997.  The original motivation for WoMan was the fact
270 that many GNU and UN*X programs are ported to other platforms and come
271 with UN*X-style manual page documentation.  This may be difficult to
272 read because ports of the UN*X-style @code{man} program can be a little
273 awkward to set up.  I decided that it should not be too hard to emulate
274 the 20 @code{man} macros directly, without treating them as macros and
275 largely ignoring the underlying @code{ROFF} requests, given the text
276 processing capabilities of Emacs.  This proved to be essentially true,
277 and it did not take a great deal of work to be able to format simple man
278 pages acceptably.
280 One problem arose with the significant number of man pages that use
281 @code{ROFF} requests in addition to the @code{man} macros, and since
282 releasing the first version of WoMan I have been continually extending
283 it to support more @code{ROFF} requests.  WoMan can now format a
284 significant proportion of the man pages that I have tested, either well
285 or at least readably.  However, I have added capabilities partly by
286 making additional passes through the document, a design that is
287 fundamentally flawed.  This can only be solved by a major re-design of
288 WoMan to handle the major formatting within a single recursive pass,
289 rather than the present multiple passes without any significant
290 recursion.  There are some @code{ROFF} requests that cannot be handled
291 satisfactorily within the present design.  Some of these are currently
292 handled by kludges that ``usually more or less work''.
294 The principle advantage of WoMan is that it does not require @code{man},
295 and indeed the name WoMan is a contraction of ``without man''.  But it
296 has other advantages.  It does not paginate the document, so it does not
297 need to un-paginate it again, thereby saving time.  It could take full
298 advantage of the display capabilities available to it, and I hope to
299 develop WoMan to take advantage of developments in Emacs itself.  At
300 present, WoMan uses several display faces to support bold and italic
301 text, to indicate other fonts, etc.  The default faces are also
302 coloured, but the choice of faces is customizable.  WoMan provides menu
303 support for navigation and mouse support for following references, in
304 addition to the navigation facilities provided by @code{man} mode.
305 WoMan has (this) texinfo documentation!
307 WoMan @emph{does not} replace @code{man}, although it does use a number
308 of the facilities implemented in the Emacs @code{man} library.  WoMan
309 and man can happily co-exist, which is very useful for comparison and
310 debugging purposes.  The only way in which WoMan affects @code{man} is
311 that it adds a timer to indicate how long @code{man} has taken to format
312 a man page.  The timing is as compatible as possible with the timing
313 built into WoMan, for as fair a comparison as possible.  The time
314 comparison seems to depend on the details of the platform, the version
315 of @code{man} in use, etc, but times are similar and WoMan is never
316 significantly slower than @code{man}.  This is despite the fact that
317 WoMan is running byte code whereas most of the formatting done by
318 @code{man} uses machine code, and is a testimony to the quality of the
319 Emacs Lisp system.
321 @code{NROFF} simulates non-@sc{ascii} characters by using one or more
322 @sc{ascii} characters.  WoMan should be able to do much better than
323 this.  I have recently begun to add support for WoMan to use more of the
324 characters in its default font and to use a symbol font, and it is an
325 aspect that I intend to develop further in the near future.  It should
326 be possible to move WoMan from an emulation of @code{NROFF} to an
327 emulation of @code{TROFF} as GNU Emacs moves to providing bit-mapped
328 display facilities.
330 @c ===================================================================
332 @node Installation, Finding, Background, Top
333 @comment  node-name,  next,  previous,  up
334 @chapter Installation and Setup
335 @cindex installation
336 @cindex setup
338 No installation is necessary if you just want to run the version of
339 WoMan distributed with GNU Emacs 21 or later, although some additional
340 setup may still be desirable.
342 If you are installing @file{woman.el}, either to update the version
343 distributed with GNU Emacs or because WoMan was not distributed with
344 your version of Emacs, then you need to put the file in a directory in
345 your Emacs load path and byte compile it.  A good directory to use is
346 the @file{site-lisp} directory in your Emacs file tree, e.g.@:
347 @file{/usr/local/share/emacs/@var{version}/site-lisp/} (where
348 @var{version} is your Emacs version), provided you have write access to
349 it.  If you use a directory that is not included by default in your
350 Emacs load path then you need to add something like this to your
351 @file{.emacs} initialisation file:
353 @lisp
354 (add-to-list 'load-path "my-lisp")
355 @end lisp
357 @noindent
358 where @file{my-lisp} is the pathname of the directory.  @xref{Init File, ,
359 The Init File ~/.emacs, emacs, The Emacs Editor}, for further details on
360 customizing Emacs in general.
362 You can byte-compile the file by using the Emacs command
363 @code{byte-compile-file} or by opening the directory containing the
364 file, putting point on it and pressing the key @kbd{B}.  (In fact, if
365 the file is compiled then it is only the compiled file that needs to be
366 in the Emacs load path, but leaving the source file there will do no
367 harm.)
369 @heading Setup
371 Setup that is either necessary or desirable consists of adding a small
372 amount of Emacs Lisp code to your @file{.emacs} initialisation file.  It
373 may be necessary (or at least convenient) to make WoMan autoload (if you
374 are not running GNU Emacs 21 or later) and to set the search path used
375 by the @code{woman} interface.  You may also find it convenient to make
376 various WoMan menu and key bindings available and to make WoMan
377 customizable even before WoMan has been loaded.
379 It is possible to run WoMan from a command line (from outside or even
380 from inside Emacs) by suitably configuring your command interpreter.
382 @menu
383 * Autoloading::         Autoloading
384 * Search Path::         Search Path
385 * Auto Bindings::       Preloading Menu and Key Bindings
386 * Auto Customization::  Preloading Customization
387 * Command Line::        Command Line Access
388 @end menu
391 @node Autoloading, Search Path, Installation, Installation
392 @comment  node-name,  next,  previous,  up
393 @section Autoloading
394 @cindex autoloading
396 If you are not running GNU Emacs 21 or later then you are recommended to
397 add these autoloads to your @file{.emacs} file:
399 @lisp
400 (autoload 'woman "woman"
401   "Decode and browse a UN*X man page." t)
402 (autoload 'woman-find-file "woman"
403   "Find, decode and browse a specific UN*X man-page file." t)
404 (autoload 'woman-dired-find-file "woman"
405   "In dired, run the WoMan man-page browser on this file." t)
406 @end lisp
408 @noindent
409 (In GNU Emacs 21 and later these autoloads are predefined.)
412 @node Search Path, Auto Bindings, Autoloading, Installation
413 @comment  node-name,  next,  previous,  up
414 @section Search Path
415 @cindex search path
417 The next step is necessary if you want to use the friendliest WoMan
418 interface, which is recommended in general.  If the @code{MANPATH}
419 environment variable is set then WoMan will use it; alternatively (or
420 additionally), if your platform uses a man configuration file (as do
421 many versions of Linux) then WoMan will use it, provided it can find it.
422 (This may need configuration.  @xref{Interface Options, , Interface
423 Options}.)  If these mechanisms correctly define the search path for man
424 pages then no further action is required.
426 Otherwise you may need to customize the user option
427 @code{woman-manpath}, and you may also want to customize the user option
428 @code{woman-path}.  @xref{Customization, , Customization}.  Now you can
429 execute the extended command @code{woman} and enter or select a manual
430 topic using completion, and if necessary select a filename, again using
431 completion.  By default, WoMan suggests the word nearest to point in the
432 current buffer as the topic.
435 @node Auto Bindings, Auto Customization, Search Path, Installation
436 @comment  node-name,  next,  previous,  up
437 @section Preloading Menu and Key Bindings
438 @cindex preloading menu and key bindings
439 @cindex menu bindings, preloading
440 @cindex key bindings, preloading
441 @cindex bindings, preloading
443 Once WoMan is loaded it adds an item to the @samp{Help} menu and defines
444 one or more keys in dired mode to run WoMan on the current file.  If you
445 would like these facilities always to be available, even before WoMan is
446 loaded, then add the following to your @file{.emacs} file:
448 @lisp
449 (define-key-after menu-bar-manuals-menu [woman]
450   '(menu-item "Read Man Page (WoMan)..." woman
451               :help "Man-page documentation Without Man") t)
453 (add-hook 'dired-mode-hook
454           (lambda ()
455             (define-key dired-mode-map "W" 'woman-dired-find-file)))
456 @end lisp
458 (By default, WoMan will automatically define the dired keys @kbd{W} and
459 @kbd{w} when it loads, but only if they are not already defined.  This
460 behaviour is controlled by the user option @code{woman-dired-keys}.
461 Note that the @code{dired-x} (dired extra) package binds
462 @code{dired-copy-filename-as-kill} to the key @kbd{w}, although @kbd{W}
463 appears to be unused.  The @code{dired-x} package will over-write the
464 WoMan binding for @kbd{w}, whereas (by default) WoMan will not overwrite
465 the @code{dired-x} binding.)
468 @node Auto Customization, Command Line, Auto Bindings, Installation
469 @comment  node-name,  next,  previous,  up
470 @section Preloading Customization
471 @cindex preloading customization
472 @cindex customization, preloading
474 WoMan supports the GNU Emacs 20+ customization facility, and puts a
475 customization group called @code{WoMan} in the @code{Help} group under
476 the top-level @code{Emacs} group.  In order to be able to customize
477 WoMan without first loading it, add the following to your @file{.emacs}
478 file:
480 @lisp
481 (defgroup woman nil
482   "Browse UNIX manual pages `wo (without) man'."
483   :tag "WoMan" :group 'help :load "woman")
484 @end lisp
487 @node Command Line,  , Auto Customization, Installation
488 @comment  node-name,  next,  previous,  up
489 @section Command Line Access
490 @cindex command line access
492 If you really want to square the man-woman circle then you can!  If you
493 run the GNU command interpreter @code{bash} then you might care to
494 define the following @code{bash} function in your @code{bash}
495 initialisation file @file{.bashrc}:
497 @example
498 man() @{ gnudoit -q '(raise-frame (selected-frame)) (woman' \"$1\" ')' ; @}
499 @end example
501 If you use a Microsoft command interpreter (@file{command.com} or
502 @file{cmd.exe}) then you can create a file called @file{man.bat}
503 somewhere in your path containing the two lines:
505 @example
506 @@echo off
507 gnudoit -q (raise-frame (selected-frame)) (woman \"%1\")
508 @end example
510 and then (e.g.@: from a command prompt or the @samp{Run...} option in the
511 Windows @samp{Start} menu) just execute
513 @example
514 man man_page_name
515 @end example
517 (Of course, if you already have a @code{man} command installed then you
518 could call these commands @code{woman} instead of @code{man}.)
520 The above examples assume that you have the @code{gnuserv} Emacs
521 client-server package installed (which I recommend).  It would be
522 possible to do something similar by calling Emacs directly, but that is
523 less satisfactory, because you are likely to end up with multiple copies
524 of Emacs running, which is generally inelegant, inefficient and
525 inconvenient.  If you run a different command interpreter then something
526 similar to the above suggestions should be possible.
528 @c ===================================================================
530 @node Finding, Browsing, Installation, Top
531 @comment  node-name,  next,  previous,  up
532 @chapter Finding and Formatting Man Pages
533 @cindex using, finding man pages
534 @cindex using, formatting man pages
535 @cindex finding man pages
536 @cindex formatting man pages
537 @cindex man pages, finding
538 @cindex man pages, formatting
540 WoMan provides three user interfaces for finding and formatting man pages:
542 @itemize @bullet
543 @item
544 a topic interface similar to that provided by the standard Emacs
545 @code{man} command;
547 @item
548 a family of filename interfaces analogous to the standard Emacs
549 @code{view-file} command;
551 @item
552 an automatic interface that detects the file type from its contents.
553 (This is currently neither well tested, well supported nor recommended!)
554 @end itemize
556 The topic and filename interfaces support completion in the usual way.
558 The topic interface is generally the most convenient for regular use,
559 although it may require some special setup, especially if your machine
560 does not already have a conventional @code{man} installation (which
561 WoMan tries to detect).
563 The simplest filename interface command @code{woman-find-file} can
564 always be used with no setup at all (provided WoMan is installed and
565 loaded or set up to autoload).
567 The automatic interface always requires special setup.
570 @heading Case-Dependence of Filenames
572 @cindex case-sensitivity
573 @vindex w32-downcase-file-names
574 By default, WoMan ignores case in file pathnames only when it seems
575 appropriate.  Microsoft Windows users who want complete case
576 independence should set the special NTEmacs variable
577 @code{w32-downcase-file-names} to @code{t} and use all lower case when
578 setting WoMan file paths.
581 @menu
582 * Topic::               Topic Interface
583 * Filename::            Filename Interface
584 * Automatic::           Automatic Interface
585 @end menu
587 @node Topic, Filename, Finding, Finding
588 @comment  node-name,  next,  previous,  up
589 @section Topic Interface
590 @cindex topic interface
592 The topic interface is accessed principally via the command
593 @code{woman}.  The same command can be accessed via the menu item
594 @samp{Help->Manuals->Read Man Page (WoMan)...} either once WoMan has been
595 loaded or if it is set up specially.  @xref{Installation, , Installation
596 and Setup}.  The command reads a manual topic in the minibuffer, which
597 can be the @dfn{basename} of a man file anywhere in the man file
598 structure.  The ``basename'' in this context means the filename without
599 any directory component and without any extension or suffix components
600 that relate to the file type.  So, for example, if there is a compressed
601 source file in Chapter 5 of the UNIX Programmer's Manual with the full
602 pathname @file{/usr/local/man/man5/man.conf.5.gz} then the topic is
603 @code{man.conf}.  Provided WoMan is configured correctly, this topic
604 will appear among the completions offered by @code{woman}.  If more than
605 one file has the same topic name then WoMan will prompt for which file
606 to format.  Completion of topics is case insensitive.
608 Clearly, @code{woman} has to know where to look for man files and there
609 are two customizable user options that store this information:
610 @code{woman-manpath} and @code{woman-path}.  @xref{Interface Options, ,
611 Interface Options}.  If @code{woman-manpath} is not set explicitly then
612 WoMan tries to pick up the information that would be used by the
613 @code{man} command, as follows.  If the environment variable
614 @code{MANPATH} is set, which seems to be the standard mechanism under
615 UNIX, then WoMan parses that.  Otherwise, if WoMan can find a
616 configuration file named (by default) @file{man.conf} (or something very
617 similar), which seems to be the standard mechanism under GNU/Linux, then
618 it parses that.  To be precise, ``something very similar'' means having
619 two name components separated by a dot and respectively containing
620 ``man'' and beginning with ``conf'', e.g.@: @file{manual.configuration}.
621 The search path and/or precise full path name for this file are set by
622 the value of the customizable user option @code{woman-man.conf-path}.
623 If all else fails, WoMan uses a plausible default man search path.
625 If the above default configuration does not work correctly for any
626 reason then simply customize the value of @code{woman-manpath}.  To
627 access man files that are not in a conventional man file hierarchy,
628 customize the value of @code{woman-path} to include the directories
629 containing the files.  In this way, @code{woman} can access manual files
630 @emph{anywhere} in the entire file system.
632 There are two differences between @code{woman-manpath} and
633 @code{woman-path}.  Firstly, the elements of @code{woman-manpath} must
634 be directories that contain @emph{directories of} man files, whereas the
635 elements of @code{woman-path} must be directories that contain man files
636 @emph{directly}.  Secondly, the last directory component of each element
637 of @code{woman-path} is treated as a regular (Emacs) match expression
638 rather than a fixed name, which allows collections of related
639 directories to be specified succinctly.
641 For topic completion to work, WoMan must build a list of all the manual
642 files that it can access, which can be very slow, especially if a
643 network is involved.  For this reason, it caches various amounts of
644 information, after which retrieving it from the cache is very fast.  If
645 the cache ever gets out of synchronism with reality, running the
646 @code{woman} command with a prefix argument (e.g.@: @kbd{C-u M-x woman})
647 will force it to rebuild its cache.  This is necessary only if the names
648 or locations of any man files change; it is not necessary if only their
649 contents change.  It would always be necessary if such a change occurred
650 whilst Emacs were running and after WoMan has been loaded.  It may be
651 necessary if such a change occurs between Emacs sessions and persistent
652 caching is used, although WoMan can detect some changes that invalidate
653 its cache and rebuild it automatically.
655 Customize the variable @code{woman-cache-filename} to save the cache
656 between Emacs sessions.  This is recommended only if the @code{woman}
657 command is too slow the first time it is run in an Emacs session, while
658 it builds its cache in main memory, which @emph{may} be @emph{very}
659 slow.  @xref{Cache, , The WoMan Topic Cache}, for further details.
662 @menu
663 * Cache::               The WoMan Topic Cache
664 * Word at point::       Using the ``Word at Point'' as a Topic Suggestion
665 @end menu
667 @node Cache, Word at point, Topic, Topic
668 @comment  node-name,  next,  previous,  up
669 @subsection The WoMan Topic Cache
670 @cindex topic cache
671 @cindex cache, topic
673 The amount of information that WoMan caches (in main memory and,
674 optionally, saved to disc) is controlled by the user option
675 @code{woman-cache-level}.  There is a trade-off between the speed with
676 which WoMan can find a file and the size of the cache, and the default
677 setting gives a reasonable compromise.
679 The @code{woman} command always performs a certain amount of caching in
680 main memory, but it can also write its cache to the filestore as a
681 persistent cache under control of the user option
682 @code{woman-cache-filename}.  If persistent caching is turned on then
683 WoMan re-loads its internal cache from the cache file almost
684 instantaneously, so that there is never any perceptible start-up delay
685 @emph{except} when WoMan rebuilds its cache.  Persistent caching is
686 currently turned off by default.  This is because users with persistent
687 caching turned on may overlook the need to force WoMan to rebuild its
688 cache the first time they run it after they have installed new man
689 files; with persistent caching turned off, WoMan automatically rebuilds
690 its cache every time it is run in a new Emacs session.
692 A prefix argument always causes the @code{woman} command (only) to
693 rebuild its topic cache, and to re-save it to
694 @code{woman-cache-filename} if this variable has a non-nil value.  This
695 is necessary if the @emph{names} of any of the directories or files in
696 the paths specified by @code{woman-manpath} or @code{woman-path} change.
697 If WoMan user options that affect the cache are changed then WoMan will
698 automatically update its cache file on disc (if one is in use) the next
699 time it is run in a new Emacs session.
702 @node Word at point,  , Cache, Topic
703 @comment  node-name,  next,  previous,  up
704 @subsection Using the ``Word at Point'' as a Topic Suggestion
705 @cindex word at point
706 @cindex point, word at
708 By default, the @code{woman} command uses the word nearest to point in
709 the current buffer as a suggestion for the topic to look up.  The topic
710 must be confirmed or edited in the minibuffer.  This suggestion can be
711 turned off, or @code{woman} can use the suggested topic without
712 confirmation if possible, which is controlled by customizing the user
713 option @code{woman-topic-at-point} to @code{nil} or @code{t}
714 respectively.  (Its default value is neither @code{nil} nor @code{t},
715 meaning ask for confirmation.)
717 The variable @code{woman-topic-at-point} can also be rebound locally
718 (using @code{let}), which may be useful to provide special private key
719 bindings, e.g.@: this key binding for @kbd{C-c w} runs WoMan on the topic
720 at point without seeking confirmation:
722 @lisp
723 (global-set-key "\C-cw"
724                 (lambda ()
725                   (interactive)
726                   (let ((woman-topic-at-point t))
727                     (woman))))
728 @end lisp
731 @node Filename, Automatic, Topic, Finding
732 @comment  node-name,  next,  previous,  up
733 @section Filename Interface
734 @cindex filename interface
736 The commands in this family are completely independent of the topic
737 interface, caching mechanism, etc.
739 @findex woman-find-file
740 The filename interface is accessed principally via the extended command
741 @code{woman-find-file}, which is available without any configuration at
742 all (provided WoMan is installed and loaded or set up to autoload).
743 This command can be used to browse any accessible man file, regardless
744 of its filename or location.  If the file is compressed then automatic
745 file decompression must already be turned on (e.g.@: see the
746 @samp{Help->Options} submenu) -- it is turned on automatically only by
747 the @code{woman} topic interface.
749 @findex woman-dired-find-file
750 Once WoMan is loaded (or if specially set up), various additional
751 commands in this family are available.  In a dired buffer, the command
752 @code{woman-dired-find-file} allows the file on the same line as point
753 to be formatted and browsed by WoMan.  It is bound to the key @kbd{W} in
754 the dired mode map and added to the dired major mode menu.  It may also
755 be bound to @kbd{w}, unless this key is bound by another library, which
756 it is by @code{dired-x}, for example.  Because it is quite likely that
757 other libraries will extend the capabilities of such a commonly used
758 mode as dired, the precise key bindings added by WoMan to the dired mode
759 map are controlled by the user option @code{woman-dired-keys}.
761 @findex woman-tar-extract-file
762 When a tar (Tape ARchive) file is visited in Emacs, it is opened in tar
763 mode, which parses the tar file and shows a dired-like view of its
764 contents.  The WoMan command @code{woman-tar-extract-file} allows the
765 file on the same line as point to be formatted and browsed by WoMan.  It
766 is bound to the key @kbd{w} in the tar mode map and added to the tar
767 major mode menu.
769 The command @code{woman-reformat-last-file}, which is bound to the key
770 @kbd{R} in WoMan mode and available on the major mode menu, reformats
771 the last file formatted by WoMan.  This may occasionally be useful if
772 formatting parameters, such as the fill column, are changed, or perhaps
773 if the buffer is somehow corrupted.
775 @findex woman-decode-buffer
776 The command @code{woman-decode-buffer} can be used to decode and browse
777 the current buffer if it is visiting a man file, although it is
778 primarily used internally by WoMan.
781 @node Automatic,  , Filename, Finding
782 @comment  node-name,  next,  previous,  up
783 @section Automatic Interface
784 @cindex automatic interface
786 Emacs provides an interface to detect automatically the format of a file
787 and decode it when it is visited.  It is used primarily by the
788 facilities for editing rich (i.e.@: formatted) text, as a way to store
789 formatting information transparently as @sc{ascii} markup.  WoMan can in
790 principle use this interface, but it must be configured explicitly.
792 This use of WoMan does not seem to be particularly advantageous, so it
793 is not really supported.  It originated during early experiments on how
794 best to implement WoMan, before I implemented the current topic
795 interface, and I subsequently stopped using it.  I might revive it as a
796 mechanism for storing pre-formatted WoMan files, somewhat analogous to
797 the standard UN*X @code{catman} facility.  In the meantime, it exists
798 for anyone who wants to experiment with it.  Once it is set up it is
799 simply a question of visiting the file and there is no WoMan-specific
800 user interface!
802 To use it, put something like this in your @file{.emacs} file.  [The
803 call to @code{set-visited-file-name} is to avoid font-locking triggered
804 by automatic major mode selection.]
806 @lisp
807 (autoload 'woman-decode-region "woman")
809 (add-to-list 'format-alist
810              '(man "UN*X man-page source format" "\\.\\(TH\\|ig\\) "
811                    woman-decode-region nil nil
812                    (lambda (arg)
813                      set-visited-file-name
814                      (file-name-sans-extension buffer-file-name))))
815 @end lisp
817 @c ===================================================================
819 @node Browsing, Customization, Finding, Top
820 @comment  node-name,  next,  previous,  up
821 @chapter Browsing Man Pages
822 @cindex using, browsing man pages
823 @cindex browsing man pages
824 @cindex man pages, browsing
826 Once a man page has been found and formatted, WoMan provides a browsing
827 interface that is essentially the same as that provided by the standard
828 Emacs @code{man} command (and much of the code is inherited from the
829 @code{man} library, which WoMan currently requires).  Many WoMan
830 facilities can be accessed from the WoMan major mode menu as well as via
831 key bindings, etc.
833 WoMan does not produce any page breaks or page numbers, and in fact does
834 not paginate the man page at all, since this is not appropriate for
835 continuous online browsing.  It produces a document header line that is
836 constructed from the standard man page header and footer.  Apart from
837 that, the appearance of the formatted man page should be almost
838 identical to what would be produced by @code{man}, with consecutive
839 blank lines squeezed to a single blank line.
841 @menu
842 * Fonts::               Fonts and Faces
843 * Navigation::          Navigation
844 * References::          Following References
845 * Changing::            Changing the Current Man Page
846 * Convenience::         Convenience Key Bindings
847 * Imenu::               Imenu Support; Contents Menu
848 @end menu
850 @node Fonts, Navigation, Browsing, Browsing
851 @comment  node-name,  next,  previous,  up
852 @section Fonts and Faces
853 @cindex fonts
854 @cindex faces
856 Fonts used by @code{ROFF} are handled by WoMan as faces, the details of
857 which are customizable.  @xref{Faces, , Faces}.  WoMan supports both the
858 italic and bold fonts normally used in man pages, together with a single
859 face to represent all unknown fonts (which are occasionally used in
860 ``non-standard'' man pages, usually to represent a ``typewriter'' font)
861 and a face to indicate additional symbols introduced by WoMan.  This
862 currently means the characters ^ and _ used to indicate super- and
863 sub-scripts, which are not displayed well by WoMan.
866 @node Navigation, References, Fonts, Browsing
867 @comment  node-name,  next,  previous,  up
868 @section Navigation
869 @cindex navigation
871 Man (and hence WoMan) mode can be thought of as a superset of view mode.
872 The buffer cannot be edited, so keys that would normally self-insert are
873 used for navigation.  The WoMan key bindings are a minor modification of
874 the @code{man} key bindings.
876 @table @kbd
877 @item @key{SPC}
878 @kindex SPC
879 @findex scroll-up
880 Scroll the man page up the window (@code{scroll-up}).
882 @item @key{DEL}
883 @kindex DEL
884 @findex scroll-down
885 Scroll the man page down the window (@code{scroll-down}).
887 @item n
888 @kindex n
889 @findex Man-next-section
890 Move point to the Nth next section -- default 1 (@code{Man-next-section}).
892 @item p
893 @kindex p
894 @findex Man-previous-section
895 Move point to Nth previous section -- default 1
896 (@code{Man-previous-section}).
898 @item g
899 @kindex g
900 @findex Man-goto-section
901 Move point to the specified section (@code{Man-goto-section}).
903 @item s
904 @kindex s
905 @findex Man-goto-see-also-section
906 Move point to the ``SEE ALSO'' section
907 (@code{Man-goto-see-also-section}).  Actually the section moved to is
908 described by @code{Man-see-also-regexp}.
909 @end table
912 @node References, Changing, Navigation, Browsing
913 @comment  node-name,  next,  previous,  up
914 @section Following References
915 @cindex following references
916 @cindex references
918 Man pages usually contain a ``SEE ALSO'' section containing references
919 to other man pages.  If these man pages are installed then WoMan can
920 easily be directed to follow the reference, i.e.@: to find and format the
921 man page.  When the mouse is passed over a correctly formatted reference
922 it is highlighted, in which case clicking the middle button
923 @key{mouse-2} will cause WoMan to follow the reference.  Alternatively,
924 when point is over such a reference the key @key{RET} will follow the
925 reference.
927 Any word in the buffer can be used as a reference by clicking
928 @key{mouse-2} over it provided the Meta key is also used (although in
929 general such a ``reference'' will not lead to a man page).
930 Alternatively, the key @kbd{r} allows completion to be used to select a
931 reference to follow, based on the word at point as default.
933 @table @kbd
934 @item @key{mouse-2}
935 @kindex mouse-2
936 @findex woman-mouse-2
937 Run WoMan with word under mouse as topic (@code{woman-mouse-2}).  The
938 word must be mouse-highlighted unless @code{woman-mouse-2} is used with
939 the Meta key.
941 @item @key{RET}
942 @kindex RET
943 @findex man-follow
944 Get the man page for the topic under (or nearest to) point
945 (@code{man-follow}).
947 @item r
948 @kindex r
949 @findex Man-follow-manual-reference
950 Get one of the man pages referred to in the ``SEE ALSO'' section
951 (@code{Man-follow-manual-reference}).  Specify which reference to use;
952 default is based on word at point.
953 @end table
956 @node Changing, Convenience, References, Browsing
957 @comment  node-name,  next,  previous,  up
958 @section Changing the Current Man Page
959 @cindex changing current man page
960 @cindex current man page, changing
962 The man page currently being browsed by WoMan can be changed in several
963 ways.  The command @code{woman} can be invoked to format another man
964 page, or the current WoMan buffer can be buried or killed.  WoMan
965 maintains a ring of formatted man pages, and it is possible to move
966 forwards and backwards in this ring by moving to the next or previous
967 man page.  It is sometimes useful to reformat the current page, for
968 example after the right margin (the wrap column) or some other
969 formatting parameter has been changed.
971 Buffers formatted by Man and WoMan are completely unrelated, even though
972 some of the commands to manipulate them are superficially the same (and
973 share code).
975 @table @kbd
976 @item m
977 @kindex m
978 @findex man
979 Run the command @code{man} to get a Un*x manual page and put it in a
980 buffer.  This command is the top-level command in the man package.  It
981 runs a Un*x command to retrieve and clean a man page in the background
982 and places the results in a Man mode (man page browsing) buffer.  If a
983 man buffer already exists for this man page, it will display
984 immediately.  This works exactly the same if WoMan is loaded, except
985 that the formatting time is displayed in the mini-buffer.
987 @item w
988 @kindex w
989 @findex woman
990 Run the command @code{woman} exactly as if the extended command or menu
991 item had been used.
993 @item q
994 @kindex q
995 @findex Man-quit
996 Bury the buffer containing the current man page (@code{Man-quit}),
997 i.e.@: move it to the bottom of the buffer stack.
999 @item k
1000 @kindex k
1001 @findex Man-kill
1002 Kill the buffer containing the current man page (@code{Man-kill}),
1003 i.e.@: delete it completely so that it can be retrieved only by formatting
1004 the page again.
1006 @item M-p
1007 @kindex M-p
1008 @findex WoMan-previous-manpage
1009 Find the previous WoMan buffer (@code{WoMan-previous-manpage}).
1011 @item M-n
1012 @kindex M-n
1013 @findex WoMan-next-manpage
1014 Find the next WoMan buffer (@code{WoMan-next-manpage}).
1016 @item R
1017 @kindex R
1018 @findex woman-reformat-last-file
1019 Call WoMan to reformat the last man page formatted by WoMan
1020 (@code{woman-reformat-last-file}), e.g.@: after changing the fill column.
1021 @end table
1024 @node Convenience, Imenu, Changing, Browsing
1025 @comment  node-name,  next,  previous,  up
1026 @section Convenience Key Bindings
1027 @cindex convenience key bindings
1028 @cindex key bindings, convenience
1030 @table @kbd
1031 @item -
1032 @kindex -
1033 @findex negative-argument
1034 Begin a negative numeric argument for the next command
1035 (@code{negative-argument}).
1037 @item 0 .. 9
1038 @kindex 0 .. 9
1039 @findex digit-argument
1040 Part of the numeric argument for the next command
1041 (@code{digit-argument}).
1043 @item <
1044 @kindex <
1045 @itemx .
1046 @kindex .
1047 @findex beginning-of-buffer
1048 Move point to the beginning of the buffer; leave mark at previous
1049 position (@code{beginning-of-buffer}).
1051 @item >
1052 @kindex >
1053 @findex end-of-buffer
1054 Move point to the end of the buffer; leave mark at previous position
1055 (@code{end-of-buffer}).
1057 @item ?
1058 @kindex ?
1059 @findex describe-mode
1060 Display documentation of current major mode and minor modes
1061 (@code{describe-mode}).  The major mode description comes first,
1062 followed by the minor modes, each on a separate page.
1063 @end table
1066 @node Imenu,  , Convenience, Browsing
1067 @comment  node-name,  next,  previous,  up
1068 @section Imenu Support; Contents Menu
1069 @cindex imenu support
1070 @cindex contents menu
1072 The WoMan menu provides an option to make a contents menu for the
1073 current man page (using @code{imenu}).  Alternatively, if you customize
1074 the option @code{woman-imenu} to @code{t} then WoMan will do it
1075 automatically for every man page.  The menu title is set by the option
1076 @code{woman-imenu-title}, which is ``CONTENTS'' by default.  The menu
1077 shows manual sections and subsections by default, but you can change
1078 this by customizing @code{woman-imenu-generic-expression}.
1080 WoMan is configured not to replace spaces in an imenu
1081 @code{*Completion*} buffer.  For further documentation on the use of
1082 imenu, such as menu sorting, see the source file @file{imenu.el}, which
1083 is distributed with GNU Emacs.
1085 @c ===================================================================
1087 @node Customization, Log, Browsing, Top
1088 @comment  node-name,  next,  previous,  up
1089 @chapter Customization
1090 @cindex customization
1092 All WoMan user options are customizable, and it is recommended to change
1093 them only via the standard Emacs customization facilities.  WoMan
1094 defines a top-level customization group called @code{WoMan} under the
1095 parent group @code{Help}.  The WoMan customization group is available
1096 only once WoMan has been loaded unless it is specially set up to be
1097 automatically available.  @xref{Auto Customization, , Preloading
1098 Customization}.  It can be accessed either via the standard Emacs
1099 facilities, e.g.@: via the @samp{Help->Customize} submenu, or via the
1100 WoMan major mode menu.
1102 The top-level WoMan group contains only a few general options and three
1103 subgroups.  The hooks are provided only for special purposes that, for
1104 example, require code to be executed, and should be changed only via
1105 @code{Customization} or the function @code{add-hook}.  Most
1106 customization should be possible via existing user options.
1108 @vtable @code
1109 @item woman-show-log
1110 A boolean value that defaults to nil.  If non-nil then show the
1111 @code{*WoMan-Log*} buffer if appropriate, i.e.@: if any warning messages
1112 are written to it.  @xref{Log, , The *WoMan-Log* Buffer}.
1114 @item woman-pre-format-hook
1115 A hook run immediately before formatting a buffer.  It might, for
1116 example, be used for face customization.  @xref{Faces, , Faces},
1117 however.
1119 @item woman-post-format-hook
1120 A hook run immediately after formatting a buffer.  It might, for
1121 example, be used for installing a dynamic menu using @code{imenu}.
1122 (However. in this case it is better to use the built-in WoMan
1123 @code{imenu} support.  @xref{Imenu, , Imenu Support; Contents Menu}.)
1124 @end vtable
1126 @heading Customization Subgroups
1128 @table @code
1129 @item WoMan Interface
1130 These options control the process of locating the appropriate file to
1131 browse, and the appearance of the browsing interface.
1133 @item WoMan Formatting
1134 These options control the layout that WoMan uses to format the man page.
1136 @item WoMan Faces
1137 These options control the display faces that WoMan uses to format the
1138 man page.
1139 @end table
1141 @menu
1142 * Interface Options::
1143 * Formatting Options::
1144 * Faces::
1145 * Special symbols::
1146 @end menu
1148 @node Interface Options, Formatting Options, Customization, Customization
1149 @comment  node-name,  next,  previous,  up
1150 @section Interface Options
1151 @cindex interface options
1153 These options control the process of locating the appropriate file to
1154 browse, and the appearance of the browsing interface.
1156 @vtable @code
1157 @item woman-man.conf-path
1158 A list of strings representing directories to search and/or files to try
1159 for a man configuration file.  The default is
1161 @lisp
1162 ("/etc" "/usr/local/lib")
1163 @end lisp
1165 @noindent
1166 [for GNU/Linux and Cygwin respectively.]  A trailing separator (@file{/}
1167 for UNIX etc.) on directories is optional and the filename matched if a
1168 directory is specified is the first to match the regexp
1169 @code{man.*\.conf}.  If the environment variable @code{MANPATH} is not
1170 set but a configuration file is found then it is parsed instead (or as
1171 well) to provide a default value for @code{woman-manpath}.
1173 @item woman-manpath
1174 A list of strings representing @emph{directory trees} to search for UN*X
1175 manual files.  Each element should be the name of a directory that
1176 contains subdirectories of the form @file{man?}, or more precisely
1177 subdirectories selected by the value of @code{woman-manpath-man-regexp}.
1178 Non-directory and unreadable files are ignored.
1180 @cindex @code{MANPATH}, environment variable
1181 If not set then the environment variable @code{MANPATH} is used.  If no
1182 such environment variable is found, the default list is determined by
1183 consulting the man configuration file if found.  By default this is
1184 expected to be either @file{/etc/man.config} or
1185 @file{/usr/local/lib/man.conf}, which is controlled by the user option
1186 @code{woman-man.conf-path}.  An empty substring of @code{MANPATH}
1187 denotes the default list.  Otherwise, the default value of this variable
1190 @lisp
1191 ("/usr/man" "/usr/local/man")
1192 @end lisp
1194 Any environment variables (names of which must have the UN*X-style form
1195 @code{$NAME}, e.g.@: @code{$HOME}, @code{$EMACSDATA}, @code{$EMACS_DIR},
1196 regardless of platform) are evaluated first but each element must
1197 evaluate to a @emph{single} directory name.  Trailing @file{/}s are
1198 ignored.  (Specific directories in @code{woman-path} are also searched.)
1200 On Microsoft platforms I recommend including drive letters explicitly,
1201 e.g.
1203 @lisp
1204 ("C:/Cygwin/usr/man" "C:/usr/man" "C:/usr/local/man")
1205 @end lisp
1207 @cindex directory separator character
1208 @cindex @code{MANPATH}, directory separator
1209 The @code{MANPATH} environment variable may be set using DOS
1210 semi-colon-separated or UN*X / Cygwin colon-separated syntax (but not
1211 mixed).
1213 @item woman-manpath-man-regexp
1214 A regular expression to match man directories @emph{under} the
1215 @code{woman-manpath} directories.  These normally have names of the form
1216 @file{man?}.  Its default value is @code{"[Mm][Aa][Nn]"}, which is
1217 case-insensitive mainly for the benefit of Microsoft platforms.  Its
1218 purpose is to avoid directories such as @file{cat?}, @file{.},
1219 @file{..}, etc.
1221 @item woman-path
1222 A list of strings representing @emph{specific directories} to search for
1223 UN*X manual files.  For example
1225 @lisp
1226 ("/emacs/etc")
1227 @end lisp
1229 These directories are searched in addition to the directory trees
1230 specified in @code{woman-manpath}.  Each element should be a directory
1231 string or @code{nil}, which represents the current directory when the
1232 path is expanded and cached.  However, the last component (only) of each
1233 directory string is treated as a regexp (Emacs, not shell) and the
1234 string is expanded into a list of matching directories.  Non-directory
1235 and unreadable files are ignored.  The default value on MS-DOS is
1237 @lisp
1238 ("$DJDIR/info" "$DJDIR/man/cat[1-9onlp]")
1239 @end lisp
1241 @noindent
1242 and on other platforms is @code{nil}.
1244 Any environment variables (names of which must have the UN*X-style form
1245 @code{$NAME}, e.g.@: @code{$HOME}, @code{$EMACSDATA}, @code{$EMACS_DIR},
1246 regardless of platform) are evaluated first but each element must
1247 evaluate to a @emph{single} directory name (regexp, see above).  For
1248 example
1250 @lisp
1251 ("$EMACSDATA")
1252 @end lisp
1254 @noindent
1255 or equivalently
1257 @lisp
1258 ("$EMACS_DIR/etc")
1259 @end lisp
1261 @noindent
1262 Trailing @file{/}s are discarded.  (The directory trees in
1263 @code{woman-manpath} are also searched.)  On Microsoft platforms I
1264 recommend including drive letters explicitly.
1266 @item woman-cache-level
1267 A positive integer representing the level of topic caching:
1269 @enumerate
1270 @item
1271 cache only the topic and directory lists (uses minimal memory, but not
1272 recommended);
1273 @item
1274 cache also the directories for each topic (faster, without using much
1275 more memory);
1276 @item
1277 cache also the actual filenames for each topic (fastest, but uses twice
1278 as much memory).
1279 @end enumerate
1281 The default value is currently 2, a good general compromise.  If the
1282 @code{woman} command is slow to find files then try 3, which may be
1283 particularly beneficial with large remote-mounted man directories.  Run
1284 the @code{woman} command with a prefix argument or delete the cache file
1285 @code{woman-cache-filename} for a change to take effect.  (Values < 1
1286 behave like 1; values > 3 behave like 3.)
1288 @item woman-cache-filename
1289 Either a string representing the full pathname of the WoMan directory
1290 and topic cache file, or @code{nil}.  It is used to save and restore the
1291 cache between Emacs sessions.  This is especially useful with
1292 remote-mounted man page files!  The default value of @code{nil}
1293 suppresses this action.  The ``standard'' non-nil filename is
1294 @file{~/.wmncach.el}.  Remember that a prefix argument forces the
1295 @code{woman} command to update and re-write the cache.
1297 @item woman-dired-keys
1298 A list of @code{dired} mode keys to be defined to run WoMan on the
1299 current file, e.g.@: @code{("w" "W")} or any non-nil atom to
1300 automatically define @kbd{w} and @kbd{W} if they are unbound, or
1301 @code{nil} to do nothing.  Default is @code{t}.
1303 @item woman-imenu-generic-expression
1304 Imenu support for Sections and Subsections: an alist with elements of
1305 the form @code{(MENU-TITLE REGEXP INDEX)} -- see the documentation for
1306 @code{imenu-generic-expression}.  Default value is
1308 @lisp
1309 ((nil "\n\\([A-Z].*\\)" 1)  ; SECTION, but not TITLE
1310  ("*Subsections*" "^   \\([A-Z].*\\)" 1))
1311 @end lisp
1313 @item woman-imenu
1314 A boolean value that defaults to @code{nil}.  If non-nil then WoMan adds
1315 a Contents menu to the menubar by calling @code{imenu-add-to-menubar}.
1317 @item woman-imenu-title
1318 A string representing the title to use if WoMan adds a Contents menu to
1319 the menubar.  Default is @code{"CONTENTS"}.
1321 @item woman-topic-at-point
1322 A symbol, which may be either @code{t}, @code{nil} or @code{confirm},
1323 that controls the use by @code{woman} of the ``word at point'' as a
1324 topic suggestion.  If it is non-nil then the @code{woman} command uses
1325 the word at point as an initial topic suggestion when it reads a topic
1326 from the minibuffer; if it is @code{t} then @code{woman} uses the word
1327 at point @emph{without interactive confirmation} if it exists as a
1328 topic.  The value @code{confirm} means suggest a topic and ask for
1329 confirmation.  The default value is that of
1330 @code{woman-topic-at-point-default}.
1332 @item woman-topic-at-point-default
1333 A symbol, which may be either @code{t}, @code{nil} or @code{confirm},
1334 representing the default value for @code{woman-topic-at-point}.  The
1335 default value is @code{confirm}.  [The variable
1336 @code{woman-topic-at-point} may be @code{let}-bound when @code{woman} is
1337 loaded, in which case its global value does not get defined.  The
1338 function @code{woman-file-name} sets it to this value if it is unbound.]
1340 @item woman-uncompressed-file-regexp
1341 A regular match expression used to select man source files (ignoring any
1342 compression extension).  The default value is
1343 @code{"\\.\\([0-9lmnt]\\w*\\)"} [which means a filename extension is
1344 required].
1346 @emph{Do not change this unless you are sure you know what you are doing!}
1348 The SysV standard man pages use two character suffixes, and this is
1349 becoming more common in the GNU world.  For example, the man pages in
1350 the @code{ncurses} package include @file{toe.1m}, @file{form.3x}, etc.
1352 @strong{Note:} an optional compression regexp will be appended, so this
1353 regexp @emph{must not} end with any kind of string terminator such as
1354 @code{$} or @code{\\'}.
1356 @item woman-file-compression-regexp
1357 A regular match expression used to match compressed man file extensions
1358 for which decompressors are available and handled by auto-compression
1359 mode.  It should begin with @code{\\.} and end with @code{\\'} and
1360 @emph{must not} be optional.  The default value is
1361 @code{"\\.\\(g?z\\|bz2\\)\\'"}, which matches the @code{gzip} and
1362 @code{bzip2} compression extensions.
1364 @emph{Do not change this unless you are sure you know what you are doing!}
1366 [It should be compatible with the @code{car} of
1367 @code{jka-compr-file-name-handler-entry}, but that is unduly
1368 complicated, includes an inappropriate extension (@file{.tgz}) and is
1369 not loaded by default!]
1371 @item woman-use-own-frame
1372 If non-nil then use a dedicated frame for displaying WoMan windows.
1373 This is useful only when WoMan is run under a window system such as X or
1374 Microsoft Windows that supports real multiple frames, in which case the
1375 default value is non-nil.
1376 @end vtable
1379 @node Formatting Options, Faces, Interface Options, Customization
1380 @comment  node-name,  next,  previous,  up
1381 @section Formatting Options
1382 @cindex formatting options
1384 These options control the layout that WoMan uses to format the man page.
1386 @vtable @code
1387 @item woman-fill-column
1388 An integer specifying the right margin for formatted text.  Default is
1391 @item woman-fill-frame
1392 A boolean value.  If non-nil then most of the frame width is used,
1393 overriding the value of @code{woman-fill-column}.  Default is nil.
1395 @item woman-default-indent
1396 An integer specifying the default prevailing indent for the @code{-man}
1397 macros.  Default is 5.  Set this variable to 7 to emulate Linux man
1398 formatting.
1400 @item woman-bold-headings
1401 A boolean value.  If non-nil then embolden section and subsection
1402 headings.  Default is t.  [Heading emboldening is @emph{not} standard
1403 @code{man} behaviour.]
1405 @item woman-ignore
1406 A boolean value.  If non-nil then unrecognised requests etc. are
1407 ignored.  Default is t.  This gives the standard @code{ROFF} behaviour.
1408 If @code{nil} then they are left in the buffer, which may aid debugging.
1410 @item woman-preserve-ascii
1411 A boolean value.  If non-nil then preserve @sc{ascii} characters in the
1412 WoMan buffer.  Otherwise, non-@sc{ascii} characters (that display as
1413 @sc{ascii}) may remain, which is irrelevant unless the buffer is to be
1414 saved to a file.  Default is nil.
1416 @item woman-emulation
1417 WoMan emulation, currently either @code{NROFF} or @code{TROFF}.  Default
1418 is @code{NROFF}.  @code{TROFF} emulation is experimental and largely
1419 untested.
1420 @end vtable
1423 @node Faces, Special symbols, Formatting Options, Customization
1424 @comment  node-name,  next,  previous,  up
1425 @section Faces
1426 @cindex faces
1428 These options control the display faces that WoMan uses to format the
1429 man page.
1431 @vtable @code
1432 @item woman-fontify
1433 A boolean value.  If non-nil then WoMan assumes that face support is
1434 available.  It defaults to a non-nil value if the display supports
1435 either colours or different fonts.
1437 @item woman-italic-face
1438 Face for italic font in man pages.  Default: italic, underlined,
1439 foreground red.  This is overkill!  @code{TROFF} uses just italic;
1440 @code{NROFF} uses just underline.  You should probably select either
1441 italic or underline as you prefer, but not both, although italic and
1442 underline work together perfectly well!
1444 @item woman-bold-face
1445 Face for bold font in man pages.  Default: bold, foreground blue.
1447 @item woman-unknown-face
1448 Face for all unknown fonts in man pages.  Default: foreground brown.
1449 Brown is a good compromise: it is distinguishable from the default but
1450 not enough so as to make font errors look terrible.  (Files that use
1451 non-standard fonts seem to do so badly or in idiosyncratic ways!)
1453 @item woman-addition-face
1454 Face for all additions made by WoMan to man pages.
1455 Default: foreground orange.
1456 @end vtable
1459 @node Special symbols,  , Faces, Customization
1460 @comment  node-name,  next,  previous,  up
1461 @section Special symbols
1462 @cindex special symbols
1464 This section currently applies @emph{only} to Microsoft Windows.
1466 WoMan provides partial experimental support for special symbols,
1467 initially only for MS-Windows and only for MS-Windows fonts.  This
1468 includes both non-@sc{ascii} characters from the main text font and use
1469 of a separate symbol font.  Later, support will be added for other font
1470 types (e.g.@: @code{bdf} fonts) and for the X Window System.  In Emacs
1471 20.7, the current support works partially under Windows 9x but may not
1472 work on any other platform.
1474 @vtable @code
1475 @item woman-use-extended-font
1476 A boolean value.  If non-nil then WoMan may use non-@sc{ascii} characters
1477 from the default font.  Default is @code{t}.
1479 @item woman-use-symbol-font
1480 A boolean value.  If non-nil then WoMan may use the symbol font.
1481 Default is @code{nil}, mainly because it may change the line spacing (at
1482 least in NTEmacs 20).
1484 @item woman-symbol-font
1485 A string describing the symbol font to use for special characters.
1486 It should be compatible with, and the same size as, the default text font.
1487 Under MS-Windows, the default is
1489 @lisp
1490 "-*-Symbol-normal-r-*-*-*-*-96-96-p-*-ms-symbol"
1491 @end lisp
1492 @end vtable
1495 @c ===================================================================
1497 @node Log, Technical, Customization, Top
1498 @comment  node-name,  next,  previous,  up
1499 @chapter The *WoMan-Log* Buffer
1500 @cindex log buffer
1501 @cindex buffer, log
1503 This is modelled on the Emacs byte-compiler.  It logs all files
1504 formatted by WoMan and the time taken.  If WoMan finds anything that it
1505 cannot handle then it writes a warning to this buffer.  If the variable
1506 @code{woman-show-log} is non-nil (by default it is @code{nil}) then
1507 WoMan automatically displays this buffer.  @xref{Interface Options, ,
1508 Interface Options}.  Many WoMan warnings can be completely ignored,
1509 because they are reporting the fact that WoMan has ignored requests that
1510 it is correct for WoMan to ignore.  In some future version this level of
1511 paranoia may be reduced, but not until WoMan is deemed more reliable.
1512 At present, all warnings should be treated with some suspicion.
1513 Uninterpreted escape sequences are also logged (in some cases).
1515 By resetting the variable @code{woman-ignore} to @code{nil} (by default
1516 it is @code{t}), uninterpreted @code{ROFF} requests can optionally be
1517 left in the formatted buffer to indicate precisely where they occurred.
1518 @xref{Interface Options, , Interface Options}.
1520 @c ===================================================================
1522 @node Technical, Bugs, Log, Top
1523 @comment  node-name,  next,  previous,  up
1524 @chapter Technical Details
1525 @cindex technical details
1526 @cindex horizontal spacing
1527 @cindex spacing, horizontal and vertical
1528 @cindex vertical spacing
1529 @cindex resolution
1531 @heading Horizontal and vertical spacing and resolution
1533 WoMan currently assumes 10 characters per inch horizontally, hence a
1534 horizontal resolution of 24 basic units, and 5 lines per inch
1535 vertically, hence a vertical resolution of 48 basic units.
1536 (@code{NROFF} uses 240 per inch.)
1538 @heading Vertical spacing and blank lines
1540 The number of consecutive blank lines in the formatted buffer should be
1541 either 0 or 1.  A blank line should leave a space like .sp 1.
1542 Current policy is to output vertical space only immediately before text
1543 is output.
1545 @c ===================================================================
1547 @node Bugs, Acknowledgements, Technical, Top
1548 @comment  node-name,  next,  previous,  up
1549 @chapter Reporting Bugs
1550 @cindex reporting bugs
1551 @cindex bugs, reporting
1553 If WoMan fails completely, or formats a file incorrectly (i.e.@:
1554 obviously wrongly or significantly differently from @code{man}) or
1555 inelegantly, then please
1557 @enumerate a
1558 @item
1559 check that you are running the latest version of @file{woman.el}
1560 available from @uref{http://centaur.maths.qmw.ac.uk/Emacs/WoMan/, my web
1561 site}, and
1563 @item
1564 check that the problem is not already described in the file
1565 @file{woman.status}, also available from
1566 @uref{http://centaur.maths.qmw.ac.uk/Emacs/WoMan/, my web site}.
1567 @end enumerate
1569 If both of the above are true then please
1570 @email{F.J.Wright@@qmw.ac.uk,email me} the entry from the
1571 @code{*WoMan-Log*} buffer relating to the problem file, together with a
1572 brief description of the problem.  Please indicate where you got the man
1573 source file from, but do not send it to me unless I ask you to!  Thanks.
1574 (At present WoMan has no automated bug-reporting facility.)
1576 @c ===================================================================
1578 @node Acknowledgements, Command Index, Bugs, Top
1579 @comment  node-name,  next,  previous,  up
1580 @chapter Acknowledgements
1581 @cindex acknowledgements
1583 For Heather, Kathryn and Madelyn, the women in my life (although they
1584 will probably never use it)!
1586 I also thank the following for helpful suggestions, bug reports, code
1587 fragments, general interest, etc.:
1589 @quotation
1590 Jari Aalto, @email{jari.aalto@@cs.tpu.fi}@*
1591 Dean Andrews, @email{dean@@dra.com}@*
1592 Juanma Barranquero, @email{barranquero@@laley-actualidad.es}@*
1593 Karl Berry, @email{kb@@cs.umb.edu}@*
1594 Jim Chapman, @email{jchapman@@netcomuk.co.uk}@*
1595 Frederic Corne, @email{frederic.corne@@erli.fr}@*
1596 Peter Craft, @email{craft@@alacritech.com}@*
1597 Charles Curley, @email{ccurley@@trib.com}@*
1598 Jim Davidson, @email{jdavidso@@teknowledge.com}@*
1599 Kevin D'Elia, @email{Kevin.DElia@@mci.com}@*
1600 John Fitch, @email{jpff@@maths.bath.ac.uk}@*
1601 Hans Frosch, @email{jwfrosch@@rish.b17c.ingr.com}@*
1602 Guy Gascoigne-Piggford, @email{ggp@@informix.com}@*
1603 Brian Gorka, @email{gorkab@@sanchez.com}@*
1604 Nicolai Henriksen, @email{nhe@@lyngso-industri.dk}@*
1605 Thomas Herchenroeder, @email{the@@software-ag.de}@*
1606 Alexander Hinds, @email{ahinds@@thegrid.net}@*
1607 Stefan Hornburg, @email{sth@@hacon.de}@*
1608 Theodore Jump, @email{tjump@@cais.com}@*
1609 Paul Kinnucan, @email{paulk@@mathworks.com}@*
1610 Jonas Linde, @email{jonas@@init.se}@*
1611 Andrew McRae, @email{andrewm@@optimation.co.nz}@*
1612 Howard Melman, @email{howard@@silverstream.com}@*
1613 Dennis Pixton, @email{dennis@@math.binghamton.edu}@*
1614 T. V. Raman, @email{raman@@Adobe.com}@*
1615 Bruce Ravel, @email{bruce.ravel@@nist.gov}@*
1616 Benjamin Riefenstahl, @email{benny@@crocodial.de}@*
1617 Kevin Ruland, @email{kruland@@seistl.com}@*
1618 Tom Schutter, @email{tom@@platte.com}@*
1619 Wei-Xue Shi, @email{wxshi@@ma.neweb.ne.jp}@*
1620 Fabio Somenzi, @email{fabio@@joplin.colorado.edu}@*
1621 Karel Sprenger, @email{ks@@ic.uva.nl}@*
1622 Chris Szurgot, @email{szurgot@@itribe.net}@*
1623 Paul A. Thompson, @email{pat@@po.cwru.edu}@*
1624 Arrigo Triulzi, @email{arrigo@@maths.qmw.ac.uk}@*
1625 Geoff Voelker, @email{voelker@@cs.washington.edu}@*
1626 Eli Zaretskii, @email{eliz@@is.elta.co.il}
1627 @end quotation
1629 @c ===================================================================
1631 @comment END OF MANUAL TEXT
1632 @page
1634 @node Command Index, Variable Index, Acknowledgements, Top
1635 @comment  node-name,           next,      previous,  up
1636 @unnumbered Command Index
1638 @printindex fn
1640 @node Variable Index, Keystroke Index, Command Index, Top
1641 @comment   node-name,            next,      previous, up
1642 @unnumbered Variable Index
1644 @printindex vr
1646 @c Without a page throw here, the page length seems to get reset to the
1647 @c depth of the index that fits on the page after the previous index.
1648 @c This must be a bug!
1650 @page
1652 @node Keystroke Index, Concept Index, Variable Index, Top
1653 @comment  node-name,            next,      previous,  up
1654 @unnumbered Keystroke Index
1656 @printindex ky
1658 @c Without a page throw here, the page length seems to get reset to the
1659 @c depth of the index that fits on the page after the previous index.
1660 @c This must be a bug!
1662 @page
1664 @node Concept Index,  , Keystroke Index, Top
1665 @comment  node-name, next,     previous, up
1666 @unnumbered Concept Index
1668 @printindex cp
1670 @bye