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