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