1 \input texinfo @c -*-texinfo-*-
3 @setfilename ../../info/woman
4 @settitle WoMan: Browse Unix Manual Pages ``W.O. (without) Man''
7 @c With different size paper the printed page breaks will need attention!
8 @c Look for @page and @need commands.
14 This file documents WoMan: A program to browse Unix manual pages `W.O.
17 Copyright @copyright{} 2001--2013 Free Software Foundation, Inc.
20 Permission is granted to copy, distribute and/or modify this document
21 under the terms of the GNU Free Documentation License, Version 1.3 or
22 any later version published by the Free Software Foundation; with no
23 Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
24 and with the Back-Cover Texts as in (a) below. A copy of the license
25 is included in the section entitled ``GNU Free Documentation License.''
27 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
28 modify this GNU manual.''
32 @dircategory Emacs misc features
34 * WoMan: (woman). Browse UN*X Manual Pages "W.O. (without) Man".
41 @subtitle Browse Unix Manual Pages ``W.O. (without) Man''
42 @subtitle as distributed with Emacs @value{EMACSVER}
43 @author Francis J. Wright
45 @author School of Mathematical Sciences
46 @author Queen Mary and Westfield College
47 @author (University of London)
48 @author Mile End Road, London E1 4NS, UK
49 @author @email{F.J.Wright@@qmul.ac.uk}
50 @author @uref{http://centaur.maths.qmw.ac.uk/}
51 @c He no longer maintains this manual.
53 @comment The following two commands start the copyright page.
55 @vskip 0pt plus 1filll
61 @c ===================================================================
65 @top WoMan: Browse Unix Manual Pages ``W.O. (without) Man''
68 As distributed with Emacs @value{EMACSVER}.
70 @email{F.J.Wright@@qmw.ac.uk, Francis J. Wright}
71 @uref{http://centaur.maths.qmw.ac.uk/, School of Mathematical Sciences}
72 Queen Mary and Westfield College (University of London)
73 Mile End Road, London E1 4NS, UK
80 * Introduction:: Introduction
81 * Background:: Background
82 * Finding:: Finding and Formatting Man Pages
83 * Browsing:: Browsing Man Pages
84 * Customization:: Customization
85 * Log:: The *WoMan-Log* Buffer
86 * Technical:: Technical Details
87 * Bugs:: Reporting Bugs
88 * Acknowledgments:: Acknowledgments
89 * GNU Free Documentation License:: The license for this documentation.
90 * Command Index:: Command Index
91 * Variable Index:: Variable Index
92 * Keystroke Index:: Keystroke Index
93 * Concept Index:: Concept Index
96 @c ===================================================================
102 This version of WoMan should run with GNU Emacs 20.3 or later on any
103 platform. It has not been tested, and may not run, with any other
104 version of Emacs. It was developed primarily on various versions of
105 Microsoft Windows, but has also been tested on MS-DOS, and various
106 versions of UNIX and GNU/Linux.
108 WoMan is distributed with GNU Emacs.
110 WoMan implements a subset of the formatting performed by the Emacs
111 @code{man} (or @code{manual-entry}) command to format a Unix-style
112 @dfn{manual page} (usually abbreviated to @dfn{man page}) for display,
113 but without calling any external programs. It is intended to emulate
114 the whole of the @code{roff -man} macro package, plus those @code{roff}
115 requests (@pxref{Background, , Background}) that are most commonly used
116 in man pages. However, the emulation is modified to include the
117 reformatting done by the Emacs @code{man} command. No hyphenation is
122 Much more direct, does not require any external programs. Supports
123 completion on man page names.
125 Not a complete emulation. Currently no support for @code{eqn} or
126 @code{tbl}. Slightly slower for large man pages (but usually faster for
127 small- and medium-size pages).
130 This browser works quite well on simple well-written man files. It
131 works less well on idiosyncratic files that ``break the rules'' or use
132 the more obscure @code{roff} requests directly. Current test results
133 are available in the file
134 @uref{http://centaur.maths.qmw.ac.uk/Emacs/WoMan/files/woman.status,
135 @file{woman.status}}.
137 WoMan supports the use of compressed man files via
138 @code{auto-compression-mode} by turning it on if necessary. But you may
139 need to adjust the user option @code{woman-file-compression-regexp}.
140 @xref{Interface Options, , Interface Options}.
142 Brief help on the WoMan interactive commands and user options, all of
143 which begin with the prefix @code{woman-} (or occasionally
144 @code{WoMan-}), is available most easily by loading WoMan and then
145 either running the command @code{woman-mini-help} or selecting the WoMan
146 menu option @samp{Mini Help}.
148 Guidance on reporting bugs is given below. @xref{Bugs, , Reporting Bugs}.
150 @c ===================================================================
156 WoMan is a browser for traditional Unix-style manual page documentation.
157 Each such document is conventionally referred to as a @dfn{manual page},
158 or @dfn{man page} for short, even though some are very much longer than
159 one page. A man page is a document written using the Unix ``man''
160 macros, which are themselves written in the nroff/troff text processing
161 markup language. @code{nroff} and @code{troff} are text processors
162 originally written for the UNIX operating system by Joseph F. Ossanna at
163 Bell Laboratories, Murray Hill, New Jersey, USA@. They are closely
164 related, and except in the few cases where the distinction between them
165 is important I will refer to them both ambiguously as @code{roff}.
167 @code{roff} markup consists of @dfn{requests} and @dfn{escape
168 sequences}. A request occupies a complete line and begins with either a
169 period or a single forward quote. An escape sequences is embedded
170 within the input text and begins (by default) with a backslash. The
171 original man macro package defines 20 new @code{roff} requests
172 implemented as macros, which were considered to be sufficient for
173 writing man pages. But whilst in principle man pages use only the man
174 macros, in practice a significant number use many other @code{roff}
177 The distinction between @code{troff} and @code{nroff} is that
178 @code{troff} was designed to drive a phototypesetter whereas
179 @code{nroff} was designed to produce essentially @acronym{ASCII} output for a
180 character-based device similar to a teletypewriter (usually abbreviated
181 to ``teletype'' or ``tty''). Hence, @code{troff} supports much finer
182 control over output positioning than does @code{nroff} and can be seen
183 as a forerunner of @TeX{}. Traditionally, man pages are either
184 formatted by @code{troff} for typesetting or by @code{nroff} for
185 printing on a character printer or displaying on a screen. Of course,
186 over the last 25 years or so, the distinction between typeset output on
187 paper and characters on a screen has become blurred by the fact that
188 most screens now support bit-mapped displays, so that any information
189 that can be printed can also be rendered on screen, the only difference
190 being the resolution.
192 Nevertheless, Unix-style manual page documentation is still normally
193 browsed on screen by running a program called @code{man}. This program
194 looks in a predefined set of directories for the man page matching a
195 specified topic, then either formats the source file by running
196 @code{nroff} or recovers a pre-formatted file, and displays it via a
197 pager such as @code{more}. @code{nroff} normally formats for a printer,
198 so it paginates the output, numbers the pages, etc., most of which is
199 irrelevant when the document is browsed as a continuous scrollable
200 document on screen. The only concession to on-screen browsing normally
201 implemented by the @code{man} program is to squeeze consecutive blank
202 lines into a single blank line.
204 For some time, Emacs has offered an improved interface for browsing man
205 pages in the form of the Emacs @code{man} (or @code{manual-entry})
206 command, see @ref{Documentation, man, Documentation Commands, emacs, GNU
208 This command runs @code{man} as described above, perhaps in
209 the background, and then post-processes the output to remove much of the
210 @code{nroff} pagination such as page headers and footers, and places the
211 result into an Emacs buffer. It puts this buffer into a special major
212 mode, which is tailored for man page browsing, and provides a number of
213 useful navigation commands, support for following references, etc. It
214 provides some support for special display faces (fonts), but no special
215 menu or mouse support. The Emacs man package appears to have been
216 developed over about 10 years, from the late 1980s to the late 1990s.
218 There is considerable inefficiency in having @code{nroff} paginate a
219 document and then removing most of the pagination!
221 WoMan is an Emacs Lisp library that provides an emulation of the
222 functionality of the Emacs @code{man} command, the main difference being
223 that WoMan does not use any external programs. The only situation in
224 which WoMan might use an external program is when the source file is
225 compressed, when WoMan will use the standard Emacs automatic
226 decompression facility, which does call an external program.
228 I began developing WoMan in the Spring of 1997 and the first version was
229 released in May 1997. The original motivation for WoMan was the fact
230 that many GNU and Unix programs are ported to other platforms and come
231 with Unix-style manual page documentation. This may be difficult to
232 read because ports of the Unix-style @code{man} program can be a little
233 awkward to set up. I decided that it should not be too hard to emulate
234 the 20 @code{man} macros directly, without treating them as macros and
235 largely ignoring the underlying @code{roff} requests, given the text
236 processing capabilities of Emacs. This proved to be essentially true,
237 and it did not take a great deal of work to be able to format simple man
240 One problem arose with the significant number of man pages that use
241 @code{roff} requests in addition to the @code{man} macros, and since
242 releasing the first version of WoMan I have been continually extending
243 it to support more @code{roff} requests. WoMan can now format a
244 significant proportion of the man pages that I have tested, either well
245 or at least readably. However, I have added capabilities partly by
246 making additional passes through the document, a design that is
247 fundamentally flawed. This can only be solved by a major re-design of
248 WoMan to handle the major formatting within a single recursive pass,
249 rather than the present multiple passes without any significant
250 recursion. There are some @code{roff} requests that cannot be handled
251 satisfactorily within the present design. Some of these are currently
252 handled by kludges that ``usually more or less work.''
254 The principle advantage of WoMan is that it does not require @code{man},
255 and indeed the name WoMan is a contraction of ``without man.'' But it
256 has other advantages. It does not paginate the document, so it does not
257 need to un-paginate it again, thereby saving time. It could take full
258 advantage of the display capabilities available to it, and I hope to
259 develop WoMan to take advantage of developments in Emacs itself. At
260 present, WoMan uses several display faces to support bold and italic
261 text, to indicate other fonts, etc. The default faces are also
262 colored, but the choice of faces is customizable. WoMan provides menu
263 support for navigation and mouse support for following references, in
264 addition to the navigation facilities provided by @code{man} mode.
265 WoMan has (this) texinfo documentation!
267 WoMan @emph{does not} replace @code{man}, although it does use a number
268 of the facilities implemented in the Emacs @code{man} library. WoMan
269 and man can happily co-exist, which is very useful for comparison and
273 @code{nroff} simulates non-@acronym{ASCII} characters by using one or more
274 @acronym{ASCII} characters. WoMan should be able to do much better than
275 this. I have recently begun to add support for WoMan to use more of the
276 characters in its default font and to use a symbol font, and it is an
277 aspect that I intend to develop further in the near future. It should
278 be possible to move WoMan from an emulation of @code{nroff} to an
279 emulation of @code{troff} as GNU Emacs moves to providing bit-mapped
284 @chapter Finding and Formatting Man Pages
285 @cindex using, finding man pages
286 @cindex using, formatting man pages
287 @cindex finding man pages
288 @cindex formatting man pages
289 @cindex man pages, finding
290 @cindex man pages, formatting
292 WoMan provides three user interfaces for finding and formatting man pages:
296 a topic interface similar to that provided by the standard Emacs
300 a family of filename interfaces analogous to the standard Emacs
301 @code{view-file} command;
304 an automatic interface that detects the file type from its contents.
305 (This is currently neither well tested, well supported nor recommended!)
308 The topic and filename interfaces support completion in the usual way.
310 The topic interface is generally the most convenient for regular use,
311 although it may require some special setup, especially if your machine
312 does not already have a conventional @code{man} installation (which
313 WoMan tries to detect).
315 The simplest filename interface command @code{woman-find-file} can
316 always be used with no setup at all (provided WoMan is installed and
317 loaded or set up to autoload).
319 The automatic interface always requires special setup.
322 @heading Case-Dependence of Filenames
324 @cindex case-sensitivity
325 @vindex w32-downcase-file-names
326 By default, WoMan ignores case in file pathnames only when it seems
327 appropriate. Microsoft Windows users who want complete case
328 independence should set the special NTEmacs variable
329 @code{w32-downcase-file-names} to @code{t} and use all lower case when
330 setting WoMan file paths.
334 * Topic:: Topic Interface
335 * Filename:: Filename Interface
336 * Automatic:: Automatic Interface
340 @section Topic Interface
341 @cindex topic interface
343 The topic interface is accessed principally via the command
344 @code{woman}. The same command can be accessed via the menu item
345 @samp{Help->Manuals->Read Man Page (WoMan)...} once WoMan has been
346 loaded. The command reads a manual topic in the minibuffer, which can
347 be the @dfn{basename} of a man file anywhere in the man file
348 structure. The ``basename'' in this context means the filename
349 without any directory component and without any extension or suffix
350 components that relate to the file type. So, for example, if there is
351 a compressed source file in Chapter 5 of the UNIX Programmer's Manual
352 with the full pathname @file{/usr/local/man/man5/man.conf.5.gz} then
353 the topic is @code{man.conf}. Provided WoMan is configured correctly,
354 this topic will appear among the completions offered by @code{woman}.
355 If more than one file has the same topic name then WoMan will prompt
356 for which file to format. Completion of topics is case insensitive.
358 Clearly, @code{woman} has to know where to look for man files and there
359 are two customizable user options that store this information:
360 @code{woman-manpath} and @code{woman-path}. @xref{Interface Options, ,
361 Interface Options}. If @code{woman-manpath} is not set explicitly then
362 WoMan tries to pick up the information that would be used by the
363 @code{man} command, as follows. If the environment variable
364 @code{MANPATH} is set, which seems to be the standard mechanism under
365 UNIX, then WoMan parses that. Otherwise, if WoMan can find a
366 configuration file named (by default) @file{man.conf} (or something very
367 similar), which seems to be the standard mechanism under GNU/Linux, then
368 it parses that. To be precise, ``something very similar'' means
369 starting with @samp{man} and ending with @samp{.conf} and possibly more
370 lowercase letters, e.g., @file{manual.configuration}.
371 The search path and/or precise full path name for this file are set by
372 the value of the customizable user option @code{woman-man.conf-path}.
373 If all else fails, WoMan uses a plausible default man search path.
375 If the above default configuration does not work correctly for any
376 reason then simply customize the value of @code{woman-manpath}. To
377 access man files that are not in a conventional man file hierarchy,
378 customize the value of @code{woman-path} to include the directories
379 containing the files. In this way, @code{woman} can access manual files
380 @emph{anywhere} in the entire file system.
382 There are two differences between @code{woman-manpath} and
383 @code{woman-path}. Firstly, the elements of @code{woman-manpath} must
384 be directories that contain @emph{directories of} man files, whereas the
385 elements of @code{woman-path} must be directories that contain man files
386 @emph{directly}. Secondly, the last directory component of each element
387 of @code{woman-path} is treated as a regular (Emacs) match expression
388 rather than a fixed name, which allows collections of related
389 directories to be specified succinctly. Also, elements of
390 @code{woman-manpath} can be conses, indicating a mapping from
391 @samp{PATH} environment variable components to man directory
394 For topic completion to work, WoMan must build a list of all the manual
395 files that it can access, which can be very slow, especially if a
396 network is involved. For this reason, it caches various amounts of
397 information, after which retrieving it from the cache is very fast. If
398 the cache ever gets out of synchronism with reality, running the
399 @code{woman} command with a prefix argument (e.g., @kbd{C-u M-x woman})
400 will force it to rebuild its cache. This is necessary only if the names
401 or locations of any man files change; it is not necessary if only their
402 contents change. It would always be necessary if such a change occurred
403 whilst Emacs were running and after WoMan has been loaded. It may be
404 necessary if such a change occurs between Emacs sessions and persistent
405 caching is used, although WoMan can detect some changes that invalidate
406 its cache and rebuild it automatically.
408 Customize the variable @code{woman-cache-filename} to save the cache
409 between Emacs sessions. This is recommended only if the @code{woman}
410 command is too slow the first time it is run in an Emacs session, while
411 it builds its cache in main memory, which @emph{may} be @emph{very}
412 slow. @xref{Cache, , The WoMan Topic Cache}, for further details.
416 * Cache:: The WoMan Topic Cache
417 * Word at point:: Using the "Word at Point" as a Topic Suggestion
421 @subsection The WoMan Topic Cache
425 The amount of information that WoMan caches (in main memory and,
426 optionally, saved to disc) is controlled by the user option
427 @code{woman-cache-level}. There is a trade-off between the speed with
428 which WoMan can find a file and the size of the cache, and the default
429 setting gives a reasonable compromise.
431 The @code{woman} command always performs a certain amount of caching in
432 main memory, but it can also write its cache to the filestore as a
433 persistent cache under control of the user option
434 @code{woman-cache-filename}. If persistent caching is turned on then
435 WoMan re-loads its internal cache from the cache file almost
436 instantaneously, so that there is never any perceptible start-up delay
437 @emph{except} when WoMan rebuilds its cache. Persistent caching is
438 currently turned off by default. This is because users with persistent
439 caching turned on may overlook the need to force WoMan to rebuild its
440 cache the first time they run it after they have installed new man
441 files; with persistent caching turned off, WoMan automatically rebuilds
442 its cache every time it is run in a new Emacs session.
444 A prefix argument always causes the @code{woman} command (only) to
445 rebuild its topic cache, and to re-save it to
446 @code{woman-cache-filename} if this variable has a non-@code{nil} value. This
447 is necessary if the @emph{names} of any of the directories or files in
448 the paths specified by @code{woman-manpath} or @code{woman-path} change.
449 If WoMan user options that affect the cache are changed then WoMan will
450 automatically update its cache file on disc (if one is in use) the next
451 time it is run in a new Emacs session.
455 @subsection Using the "Word at Point" as a Topic Suggestion
456 @cindex word at point
457 @cindex point, word at
459 By default, the @code{woman} command uses the word nearest to point in
460 the current buffer as a suggestion for the topic to look up, if it
461 exists as a valid topic. The topic can be confirmed or edited in the
464 You can also bind the variable @code{woman-use-topic-at-point} locally
465 to a non-@code{nil} value (using @code{let}), in which case
466 @code{woman} will can use the suggested topic without confirmation if
467 possible. This may be useful to provide special private key bindings,
468 e.g., this key binding for @kbd{C-c w} runs WoMan on the topic at
469 point without seeking confirmation:
472 (global-set-key "\C-cw"
475 (let ((woman-use-topic-at-point t))
481 @section Filename Interface
482 @cindex filename interface
484 The commands in this family are completely independent of the topic
485 interface, caching mechanism, etc.
487 @findex woman-find-file
488 The filename interface is accessed principally via the extended command
489 @code{woman-find-file}, which is available without any configuration at
490 all (provided WoMan is installed and loaded or set up to autoload).
491 This command can be used to browse any accessible man file, regardless
492 of its filename or location. If the file is compressed then automatic
493 file decompression must already be turned on (e.g., see the
494 @samp{Help->Options} submenu)---it is turned on automatically only by
495 the @code{woman} topic interface.
497 @findex woman-dired-find-file
498 Once WoMan is loaded (or if specially set up), various additional
499 commands in this family are available. In a dired buffer, the command
500 @code{woman-dired-find-file} allows the file on the same line as point
501 to be formatted and browsed by WoMan. It is bound to the key @kbd{W} in
502 the dired mode map and added to the dired major mode menu. It may also
503 be bound to @kbd{w}, unless this key is bound by another library, which
504 it is by @code{dired-x}, for example. Because it is quite likely that
505 other libraries will extend the capabilities of such a commonly used
506 mode as dired, the precise key bindings added by WoMan to the dired mode
507 map are controlled by the user option @code{woman-dired-keys}.
509 @findex woman-tar-extract-file
510 When a tar (Tape ARchive) file is visited in Emacs, it is opened in tar
511 mode, which parses the tar file and shows a dired-like view of its
512 contents. The WoMan command @code{woman-tar-extract-file} allows the
513 file on the same line as point to be formatted and browsed by WoMan. It
514 is bound to the key @kbd{w} in the tar mode map and added to the tar
517 The command @code{woman-reformat-last-file}, which is bound to the key
518 @kbd{R} in WoMan mode and available on the major mode menu, reformats
519 the last file formatted by WoMan. This may occasionally be useful if
520 formatting parameters, such as the fill column, are changed, or perhaps
521 if the buffer is somehow corrupted.
523 @findex woman-decode-buffer
524 The command @code{woman-decode-buffer} can be used to decode and browse
525 the current buffer if it is visiting a man file, although it is
526 primarily used internally by WoMan.
530 @section Automatic Interface
531 @cindex automatic interface
533 Emacs provides an interface to detect automatically the format of a file
534 and decode it when it is visited. It is used primarily by the
535 facilities for editing rich (i.e., formatted) text, as a way to store
536 formatting information transparently as @acronym{ASCII} markup. WoMan can in
537 principle use this interface, but it must be configured explicitly.
539 This use of WoMan does not seem to be particularly advantageous, so it
540 is not really supported. It originated during early experiments on how
541 best to implement WoMan, before I implemented the current topic
542 interface, and I subsequently stopped using it. I might revive it as a
543 mechanism for storing pre-formatted WoMan files, somewhat analogous to
544 the standard Unix @code{catman} facility. In the meantime, it exists
545 for anyone who wants to experiment with it. Once it is set up it is
546 simply a question of visiting the file and there is no WoMan-specific
549 To use it, put something like this in your @file{.emacs} file. [The
550 call to @code{set-visited-file-name} is to avoid font-locking triggered
551 by automatic major mode selection.]
554 (autoload 'woman-decode-region "woman")
556 (add-to-list 'format-alist
557 '(man "Unix man-page source format" "\\.\\(TH\\|ig\\) "
558 woman-decode-region nil nil
560 set-visited-file-name
561 (file-name-sans-extension buffer-file-name))))
564 @c ===================================================================
567 @chapter Browsing Man Pages
568 @cindex using, browsing man pages
569 @cindex browsing man pages
570 @cindex man pages, browsing
572 Once a man page has been found and formatted, WoMan provides a browsing
573 interface that is essentially the same as that provided by the standard
574 Emacs @code{man} command (and much of the code is inherited from the
575 @code{man} library, which WoMan currently requires). Many WoMan
576 facilities can be accessed from the WoMan major mode menu as well as via
579 WoMan does not produce any page breaks or page numbers, and in fact does
580 not paginate the man page at all, since this is not appropriate for
581 continuous online browsing. It produces a document header line that is
582 constructed from the standard man page header and footer. Apart from
583 that, the appearance of the formatted man page should be almost
584 identical to what would be produced by @code{man}, with consecutive
585 blank lines squeezed to a single blank line.
588 * Fonts:: Fonts and Faces
589 * Navigation:: Navigation
590 * References:: Following References
591 * Changing:: Changing the Current Man Page
592 * Convenience:: Convenience Key Bindings
593 * Imenu:: Imenu Support; Contents Menu
597 @section Fonts and Faces
601 Fonts used by @code{roff} are handled by WoMan as faces, the details of
602 which are customizable. @xref{Faces, , Faces}. WoMan supports both the
603 italic and bold fonts normally used in man pages, together with a single
604 face to represent all unknown fonts (which are occasionally used in
605 ``non-standard'' man pages, usually to represent a ``typewriter'' font)
606 and a face to indicate additional symbols introduced by WoMan. This
607 currently means the characters ^ and _ used to indicate super- and
608 sub-scripts, which are not displayed well by WoMan.
615 Man (and hence WoMan) mode can be thought of as a superset of view mode.
616 The buffer cannot be edited, so keys that would normally self-insert are
617 used for navigation. The WoMan key bindings are a minor modification of
618 the @code{man} key bindings.
624 Scroll the man page up the window (@code{scroll-up}).
629 Scroll the man page down the window (@code{scroll-down}).
633 @findex Man-next-section
634 Move point to the Nth next section---default 1 (@code{Man-next-section}).
638 @findex Man-previous-section
639 Move point to Nth previous section---default 1
640 (@code{Man-previous-section}).
644 @findex Man-goto-section
645 Move point to the specified section (@code{Man-goto-section}).
649 @findex Man-goto-see-also-section
650 Move point to the ``SEE ALSO'' section
651 (@code{Man-goto-see-also-section}). Actually the section moved to is
652 described by @code{Man-see-also-regexp}.
657 @section Following References
658 @cindex following references
661 Man pages usually contain a ``SEE ALSO'' section containing references
662 to other man pages. If these man pages are installed then WoMan can
663 easily be directed to follow the reference, i.e., to find and format the
664 man page. When the mouse is passed over a correctly formatted reference
665 it is highlighted, in which case clicking the middle button
666 @kbd{Mouse-2} will cause WoMan to follow the reference. Alternatively,
667 when point is over such a reference the key @key{RET} will follow the
670 Any word in the buffer can be used as a reference by clicking
671 @kbd{Mouse-2} over it provided the Meta key is also used (although in
672 general such a ``reference'' will not lead to a man page).
673 Alternatively, the key @kbd{r} allows completion to be used to select a
674 reference to follow, based on the word at point as default.
679 @findex woman-mouse-2
680 Run WoMan with word under mouse as topic (@code{woman-mouse-2}). The
681 word must be mouse-highlighted unless @code{woman-mouse-2} is used with
687 Get the man page for the topic under (or nearest to) point
692 @findex Man-follow-manual-reference
693 Get one of the man pages referred to in the ``SEE ALSO'' section
694 (@code{Man-follow-manual-reference}). Specify which reference to use;
695 default is based on word at point.
700 @section Changing the Current Man Page
701 @cindex changing current man page
702 @cindex current man page, changing
704 The man page currently being browsed by WoMan can be changed in several
705 ways. The command @code{woman} can be invoked to format another man
706 page, or the current WoMan buffer can be buried or killed. WoMan
707 maintains a ring of formatted man pages, and it is possible to move
708 forwards and backwards in this ring by moving to the next or previous
709 man page. It is sometimes useful to reformat the current page, for
710 example after the right margin (the wrap column) or some other
711 formatting parameter has been changed.
713 Buffers formatted by Man and WoMan are completely unrelated, even though
714 some of the commands to manipulate them are superficially the same (and
721 Run the command @code{man} to get a Un*x manual page and put it in a
722 buffer. This command is the top-level command in the man package. It
723 runs a Un*x command to retrieve and clean a man page in the background
724 and places the results in a Man mode (man page browsing) buffer. If a
725 man buffer already exists for this man page, it will display
726 immediately. This works exactly the same if WoMan is loaded, except
727 that the formatting time is displayed in the mini-buffer.
732 Run the command @code{woman} exactly as if the extended command or menu
738 Bury the buffer containing the current man page (@code{Man-quit}),
739 i.e., move it to the bottom of the buffer stack.
744 Kill the buffer containing the current man page (@code{Man-kill}),
745 i.e., delete it completely so that it can be retrieved only by formatting
750 @findex WoMan-previous-manpage
751 Find the previous WoMan buffer (@code{WoMan-previous-manpage}).
755 @findex WoMan-next-manpage
756 Find the next WoMan buffer (@code{WoMan-next-manpage}).
760 @findex woman-reformat-last-file
761 Call WoMan to reformat the last man page formatted by WoMan
762 (@code{woman-reformat-last-file}), e.g., after changing the fill column.
767 @section Convenience Key Bindings
768 @cindex convenience key bindings
769 @cindex key bindings, convenience
774 @findex negative-argument
775 Begin a negative numeric argument for the next command
776 (@code{negative-argument}).
780 @findex digit-argument
781 Part of the numeric argument for the next command
782 (@code{digit-argument}).
788 @findex beginning-of-buffer
789 Move point to the beginning of the buffer; leave mark at previous
790 position (@code{beginning-of-buffer}).
794 @findex end-of-buffer
795 Move point to the end of the buffer; leave mark at previous position
796 (@code{end-of-buffer}).
800 @findex describe-mode
801 Display documentation of current major mode and minor modes
802 (@code{describe-mode}). The major mode description comes first,
803 followed by the minor modes, each on a separate page.
808 @section Imenu Support; Contents Menu
809 @cindex imenu support
810 @cindex contents menu
812 The WoMan menu provides an option to make a contents menu for the
813 current man page (using @code{imenu}). Alternatively, if you customize
814 the option @code{woman-imenu} to @code{t} then WoMan will do it
815 automatically for every man page. The menu title is set by the option
816 @code{woman-imenu-title}, which is ``CONTENTS'' by default. The menu
817 shows manual sections and subsections by default, but you can change
818 this by customizing @code{woman-imenu-generic-expression}.
820 WoMan is configured not to replace spaces in an imenu
821 @code{*Completion*} buffer. For further documentation on the use of
822 imenu, such as menu sorting, see the source file @file{imenu.el}, which
823 is distributed with GNU Emacs.
825 @c ===================================================================
828 @chapter Customization
829 @cindex customization
831 All WoMan user options are customizable, and it is recommended to
832 change them only via the standard Emacs customization facilities.
833 WoMan defines a top-level customization group called @code{WoMan}
834 under the parent group @code{Help}. It can be accessed either via the
835 standard Emacs facilities, e.g., via the @samp{Help->Customize}
836 submenu, or via the WoMan major mode menu.
838 The top-level WoMan group contains only a few general options and three
839 subgroups. The hooks are provided only for special purposes that, for
840 example, require code to be executed, and should be changed only via
841 @code{Customization} or the function @code{add-hook}. Most
842 customization should be possible via existing user options.
846 A boolean value that defaults to @code{nil}. If non-@code{nil} then show the
847 @code{*WoMan-Log*} buffer if appropriate, i.e., if any warning messages
848 are written to it. @xref{Log, , The *WoMan-Log* Buffer}.
850 @item woman-pre-format-hook
851 A hook run immediately before formatting a buffer. It might, for
852 example, be used for face customization. @xref{Faces, , Faces},
855 @item woman-post-format-hook
856 A hook run immediately after formatting a buffer. It might, for
857 example, be used for installing a dynamic menu using @code{imenu}.
858 (However. in this case it is better to use the built-in WoMan
859 @code{imenu} support. @xref{Imenu, , Imenu Support; Contents Menu}.)
862 @heading Customization Subgroups
865 @item WoMan Interface
866 These options control the process of locating the appropriate file to
867 browse, and the appearance of the browsing interface.
869 @item WoMan Formatting
870 These options control the layout that WoMan uses to format the man page.
873 These options control the display faces that WoMan uses to format the
878 * Interface Options::
879 * Formatting Options::
884 @node Interface Options
885 @section Interface Options
886 @cindex interface options
888 These options control the process of locating the appropriate file to
889 browse, and the appearance of the browsing interface.
892 @item woman-man.conf-path
893 A list of strings representing directories to search and/or files to try
894 for a man configuration file. The default is
897 ("/etc" "/usr/local/lib")
901 [for GNU/Linux and Cygwin respectively.] A trailing separator (@file{/}
902 for UNIX etc.)@: on directories is optional and the filename matched if a
903 directory is specified is the first to match the regexp
904 @code{man.*\.conf}. If the environment variable @code{MANPATH} is not
905 set but a configuration file is found then it is parsed instead (or as
906 well) to provide a default value for @code{woman-manpath}.
909 A list of strings representing @emph{directory trees} to search for Unix
910 manual files. Each element should be the name of a directory that
911 contains subdirectories of the form @file{man?}, or more precisely
912 subdirectories selected by the value of @code{woman-manpath-man-regexp}.
913 Non-directory and unreadable files are ignored. This can also contain
914 conses, with the car indicating a @code{PATH} variable component mapped
915 to the directory tree given in the cdr.
917 @cindex @code{MANPATH}, environment variable
918 If not set then the environment variable @code{MANPATH} is used. If no
919 such environment variable is found, the default list is determined by
920 consulting the man configuration file if found. By default this is
921 expected to be either @file{/etc/man.config} or
922 @file{/usr/local/lib/man.conf}, which is controlled by the user option
923 @code{woman-man.conf-path}. An empty substring of @code{MANPATH}
924 denotes the default list. Otherwise, the default value of this variable
928 ("/usr/man" "/usr/local/man")
931 Any environment variables (names of which must have the Unix-style form
932 @code{$NAME}, e.g., @code{$HOME}, @code{$EMACSDATA}, @code{$EMACS_DIR},
933 regardless of platform) are evaluated first but each element must
934 evaluate to a @emph{single} directory name. Trailing @file{/}s are
935 ignored. (Specific directories in @code{woman-path} are also searched.)
937 On Microsoft platforms I recommend including drive letters explicitly,
941 ("C:/Cygwin/usr/man" "C:/usr/man" "C:/usr/local/man")
944 @cindex directory separator character
945 @cindex @code{MANPATH}, directory separator
946 The @code{MANPATH} environment variable may be set using DOS
947 semi-colon-separated or Unix-style colon-separated syntax (but not
950 @item woman-manpath-man-regexp
951 A regular expression to match man directories @emph{under} the
952 @code{woman-manpath} directories. These normally have names of the form
953 @file{man?}. Its default value is @code{"[Mm][Aa][Nn]"}, which is
954 case-insensitive mainly for the benefit of Microsoft platforms. Its
955 purpose is to avoid directories such as @file{cat?}, @file{.},
959 A list of strings representing @emph{specific directories} to search for
960 Unix manual files. For example
966 These directories are searched in addition to the directory trees
967 specified in @code{woman-manpath}. Each element should be a directory
968 string or @code{nil}, which represents the current directory when the
969 path is expanded and cached. However, the last component (only) of each
970 directory string is treated as a regexp (Emacs, not shell) and the
971 string is expanded into a list of matching directories. Non-directory
972 and unreadable files are ignored. The default value on MS-DOS is
975 ("$DJDIR/info" "$DJDIR/man/cat[1-9onlp]")
979 and on other platforms is @code{nil}.
981 Any environment variables (names of which must have the Unix-style form
982 @code{$NAME}, e.g., @code{$HOME}, @code{$EMACSDATA}, @code{$EMACS_DIR},
983 regardless of platform) are evaluated first but each element must
984 evaluate to a @emph{single} directory name (regexp, see above). For
999 Trailing @file{/}s are discarded. (The directory trees in
1000 @code{woman-manpath} are also searched.) On Microsoft platforms I
1001 recommend including drive letters explicitly.
1003 @item woman-cache-level
1004 A positive integer representing the level of topic caching:
1008 cache only the topic and directory lists (uses minimal memory, but not
1011 cache also the directories for each topic (faster, without using much
1014 cache also the actual filenames for each topic (fastest, but uses twice
1018 The default value is currently 2, a good general compromise. If the
1019 @code{woman} command is slow to find files then try 3, which may be
1020 particularly beneficial with large remote-mounted man directories. Run
1021 the @code{woman} command with a prefix argument or delete the cache file
1022 @code{woman-cache-filename} for a change to take effect. (Values < 1
1023 behave like 1; values > 3 behave like 3.)
1025 @item woman-cache-filename
1026 Either a string representing the full pathname of the WoMan directory
1027 and topic cache file, or @code{nil}. It is used to save and restore the
1028 cache between Emacs sessions. This is especially useful with
1029 remote-mounted man page files! The default value of @code{nil}
1030 suppresses this action. The ``standard'' non-@code{nil} filename is
1031 @file{~/.wmncach.el}. Remember that a prefix argument forces the
1032 @code{woman} command to update and re-write the cache.
1034 @item woman-dired-keys
1035 A list of @code{dired} mode keys to be defined to run WoMan on the
1036 current file, e.g., @code{("w" "W")} or any non-@code{nil} atom to
1037 automatically define @kbd{w} and @kbd{W} if they are unbound, or
1038 @code{nil} to do nothing. Default is @code{t}.
1040 @item woman-imenu-generic-expression
1041 Imenu support for Sections and Subsections: an alist with elements of
1042 the form @code{(MENU-TITLE REGEXP INDEX)}---see the documentation for
1043 @code{imenu-generic-expression}. Default value is
1046 ((nil "\n\\([A-Z].*\\)" 1) ; SECTION, but not TITLE
1047 ("*Subsections*" "^ \\([A-Z].*\\)" 1))
1051 A boolean value that defaults to @code{nil}. If non-@code{nil} then WoMan adds
1052 a Contents menu to the menubar by calling @code{imenu-add-to-menubar}.
1054 @item woman-imenu-title
1055 A string representing the title to use if WoMan adds a Contents menu to
1056 the menubar. Default is @code{"CONTENTS"}.
1058 @item woman-use-topic-at-point
1059 A boolean value that defaults to @code{nil}. If non-@code{nil} then
1060 the @code{woman} command uses the word at point as the topic,
1061 @emph{without interactive confirmation}, if it exists as a topic.
1063 @item woman-use-topic-at-point-default
1064 A boolean value representing the default value for
1065 @code{woman-use-topic-at-point}. The default value is @code{nil}.
1066 [The variable @code{woman-use-topic-at-point} may be @code{let}-bound
1067 when @code{woman} is loaded, in which case its global value does not
1068 get defined. The function @code{woman-file-name} sets it to this
1069 value if it is unbound.]
1071 @item woman-uncompressed-file-regexp
1072 A regular match expression used to select man source files (ignoring any
1073 compression extension). The default value is
1074 @code{"\\.\\([0-9lmnt]\\w*\\)"} [which means a filename extension is
1077 @emph{Do not change this unless you are sure you know what you are doing!}
1079 The SysV standard man pages use two character suffixes, and this is
1080 becoming more common in the GNU world. For example, the man pages in
1081 the @code{ncurses} package include @file{toe.1m}, @file{form.3x}, etc.
1083 @strong{Please note:} an optional compression regexp will be appended,
1084 so this regexp @emph{must not} end with any kind of string terminator
1085 such as @code{$} or @code{\\'}.
1087 @item woman-file-compression-regexp
1088 A regular match expression used to match compressed man file extensions
1089 for which decompressors are available and handled by auto-compression
1090 mode. It should begin with @code{\\.} and end with @code{\\'} and
1091 @emph{must not} be optional. The default value is
1092 @code{"\\.\\(g?z\\|bz2\\|xz\\)\\'"}, which matches the @code{gzip},
1093 @code{bzip2}, and @code{xz} compression extensions.
1095 @emph{Do not change this unless you are sure you know what you are doing!}
1097 [It should be compatible with the @code{car} of
1098 @code{jka-compr-file-name-handler-entry}, but that is unduly
1099 complicated, includes an inappropriate extension (@file{.tgz}) and is
1100 not loaded by default!]
1102 @item woman-use-own-frame
1103 If non-@code{nil} then use a dedicated frame for displaying WoMan windows.
1104 This is useful only when WoMan is run under a window system such as X or
1105 Microsoft Windows that supports real multiple frames, in which case the
1106 default value is non-@code{nil}.
1110 @node Formatting Options
1111 @section Formatting Options
1112 @cindex formatting options
1114 These options control the layout that WoMan uses to format the man page.
1117 @item woman-fill-column
1118 An integer specifying the right margin for formatted text. Default is
1121 @item woman-fill-frame
1122 A boolean value. If non-@code{nil} then most of the frame width is used,
1123 overriding the value of @code{woman-fill-column}. Default is @code{nil}.
1125 @item woman-default-indent
1126 An integer specifying the default prevailing indent for the @code{-man}
1127 macros. Default is 5. Set this variable to 7 to emulate GNU/Linux man
1130 @item woman-bold-headings
1131 A boolean value. If non-@code{nil} then embolden section and subsection
1132 headings. Default is @code{t}. [Heading emboldening is @emph{not} standard
1133 @code{man} behavior.]
1136 A boolean value. If non-@code{nil} then unrecognized requests etc. are
1137 ignored. Default is @code{t}. This gives the standard @code{roff} behavior.
1138 If @code{nil} then they are left in the buffer, which may aid debugging.
1140 @item woman-preserve-ascii
1141 A boolean value. If non-@code{nil} then preserve @acronym{ASCII} characters in the
1142 WoMan buffer. Otherwise, non-@acronym{ASCII} characters (that display as
1143 @acronym{ASCII}) may remain, which is irrelevant unless the buffer is to be
1144 saved to a file. Default is @code{nil}.
1146 @item woman-emulation
1147 WoMan emulation, currently either @code{nroff} or @code{troff}. Default
1148 is @code{nroff}. @code{troff} emulation is experimental and largely
1157 These options control the display faces that WoMan uses to format the
1162 A boolean value. If non-@code{nil} then WoMan assumes that face support is
1163 available. It defaults to a non-@code{nil} value if the display supports
1164 either colors or different fonts.
1166 @item woman-italic-face
1167 Face for italic font in man pages. Default: italic, underlined,
1168 foreground red. This is overkill! @code{troff} uses just italic;
1169 @code{nroff} uses just underline. You should probably select either
1170 italic or underline as you prefer, but not both, although italic and
1171 underline work together perfectly well!
1173 @item woman-bold-face
1174 Face for bold font in man pages. Default: bold, foreground blue.
1176 @item woman-unknown-face
1177 Face for all unknown fonts in man pages. Default: foreground brown.
1178 Brown is a good compromise: it is distinguishable from the default but
1179 not enough so as to make font errors look terrible. (Files that use
1180 non-standard fonts seem to do so badly or in idiosyncratic ways!)
1182 @item woman-addition-face
1183 Face for all additions made by WoMan to man pages.
1184 Default: foreground orange.
1188 @node Special symbols
1189 @section Special symbols
1190 @cindex special symbols
1192 This section currently applies @emph{only} to Microsoft Windows.
1194 WoMan provides partial experimental support for special symbols,
1195 initially only for MS-Windows and only for MS-Windows fonts. This
1196 includes both non-@acronym{ASCII} characters from the main text font and use
1197 of a separate symbol font. Later, support will be added for other font
1198 types (e.g., @code{bdf} fonts) and for the X Window System. In Emacs
1199 20.7, the current support works partially under Windows 9x but may not
1200 work on any other platform.
1203 @item woman-use-extended-font
1204 A boolean value. If non-@code{nil} then WoMan may use non-@acronym{ASCII} characters
1205 from the default font. Default is @code{t}.
1207 @item woman-use-symbol-font
1208 A boolean value. If non-@code{nil} then WoMan may use the symbol font.
1209 Default is @code{nil}, mainly because it may change the line spacing (at
1210 least in NTEmacs 20).
1212 @item woman-symbol-font
1213 A string describing the symbol font to use for special characters.
1214 It should be compatible with, and the same size as, the default text font.
1215 Under MS-Windows, the default is
1218 "-*-Symbol-normal-r-*-*-*-*-96-96-p-*-ms-symbol"
1223 @c ===================================================================
1226 @chapter The *WoMan-Log* Buffer
1230 This is modeled on the Emacs byte-compiler. It logs all files
1231 formatted by WoMan and the time taken. If WoMan finds anything that it
1232 cannot handle then it writes a warning to this buffer. If the variable
1233 @code{woman-show-log} is non-@code{nil} (by default it is @code{nil}) then
1234 WoMan automatically displays this buffer. @xref{Interface Options, ,
1235 Interface Options}. Many WoMan warnings can be completely ignored,
1236 because they are reporting the fact that WoMan has ignored requests that
1237 it is correct for WoMan to ignore. In some future version this level of
1238 paranoia may be reduced, but not until WoMan is deemed more reliable.
1239 At present, all warnings should be treated with some suspicion.
1240 Uninterpreted escape sequences are also logged (in some cases).
1242 By resetting the variable @code{woman-ignore} to @code{nil} (by default
1243 it is @code{t}), uninterpreted @code{roff} requests can optionally be
1244 left in the formatted buffer to indicate precisely where they occurred.
1245 @xref{Interface Options, , Interface Options}.
1247 @c ===================================================================
1250 @chapter Technical Details
1251 @cindex technical details
1252 @cindex horizontal spacing
1253 @cindex spacing, horizontal and vertical
1254 @cindex vertical spacing
1257 @heading Horizontal and vertical spacing and resolution
1259 WoMan currently assumes 10 characters per inch horizontally, hence a
1260 horizontal resolution of 24 basic units, and 5 lines per inch
1261 vertically, hence a vertical resolution of 48 basic units.
1262 (@code{nroff} uses 240 per inch.)
1264 @heading Vertical spacing and blank lines
1266 The number of consecutive blank lines in the formatted buffer should be
1267 either 0 or 1. A blank line should leave a space like .sp 1.
1268 Current policy is to output vertical space only immediately before text
1271 @c ===================================================================
1274 @chapter Reporting Bugs
1275 @cindex reporting bugs
1276 @cindex bugs, reporting
1278 If WoMan fails completely, or formats a file incorrectly (i.e.,
1279 obviously wrongly or significantly differently from @code{man}) or
1280 inelegantly, then please
1284 try the latest version of @file{woman.el} from the Emacs repository
1285 on @uref{http://savannah.gnu.org/projects/emacs/}. If it still fails, please
1288 use @kbd{M-x report-emacs-bug} to send a bug report.
1289 Please include the entry from the
1290 @code{*WoMan-Log*} buffer relating to the problem file, together with
1291 a brief description of the problem. Please indicate where you got the
1292 man source file from, but do not send it unless asked to send it.
1295 @c ===================================================================
1297 @node Acknowledgments
1298 @chapter Acknowledgments
1299 @cindex acknowledgments
1301 For Heather, Kathryn and Madelyn, the women in my life (although they
1302 will probably never use it)!
1304 I also thank the following for helpful suggestions, bug reports, code
1305 fragments, general interest, etc.:
1308 @c jari.aalto@@cs.tpu.fi
1312 @c barranquero@@laley-actualidad.es
1316 @c jchapman@@netcomuk.co.uk
1318 @c frederic.corne@@erli.fr
1320 @c craft@@alacritech.com
1322 @c ccurley@@trib.com
1324 @c jdavidso@@teknowledge.com
1326 @c Kevin.DElia@@mci.com
1328 @c jpff@@maths.bath.ac.uk
1330 @c jwfrosch@@rish.b17c.ingr.com
1332 @c ggp@@informix.com
1333 Guy Gascoigne-Piggford,
1334 @c gorkab@@sanchez.com
1336 @c nhe@@lyngso-industri.dk
1338 @c the@@software-ag.de
1339 Thomas Herchenroeder,
1340 @c ahinds@@thegrid.net
1346 @c paulk@@mathworks.com
1350 @c andrewm@@optimation.co.nz
1352 @c howard@@silverstream.com
1354 @c dennis@@math.binghamton.edu
1358 @c bruce.ravel@@nist.gov
1360 @c benny@@crocodial.de
1361 Benjamin Riefenstahl,
1362 @c kruland@@seistl.com
1366 @c wxshi@@ma.neweb.ne.jp
1368 @c fabio@@joplin.colorado.edu
1372 @c szurgot@@itribe.net
1376 @c arrigo@@maths.qmw.ac.uk
1378 @c voelker@@cs.washington.edu
1380 @c eliz@@is.elta.co.il
1384 @c ===================================================================
1386 @comment END OF MANUAL TEXT
1390 @node GNU Free Documentation License
1391 @appendix GNU Free Documentation License
1392 @include doclicense.texi
1395 @unnumbered Command Index
1399 @node Variable Index
1400 @unnumbered Variable Index
1404 @c Without a page throw here, the page length seems to get reset to the
1405 @c depth of the index that fits on the page after the previous index.
1406 @c This must be a bug!
1410 @node Keystroke Index
1411 @unnumbered Keystroke Index
1415 @c Without a page throw here, the page length seems to get reset to the
1416 @c depth of the index that fits on the page after the previous index.
1417 @c This must be a bug!
1422 @unnumbered Concept Index