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