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