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