manpagez: man pages & more
info emacs
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

31.6.2 Man Page Lookup

On Unix, the main form of on-line documentation was the manual page or man page. In the GNU operating system, we aim to replace man pages with better-organized manuals that you can browse with Info (see section Other Help Commands). This process is not finished, so it is still useful to read manual pages.

You can read the man page for an operating system command, library function, or system call, with the M-x man command. It runs the man program to format the man page; if the system permits, it runs man asynchronously, so that you can keep on editing while the page is being formatted. (On MS-DOS and MS-Windows 3, you cannot edit while Emacs waits for man to finish.) The result goes in a buffer named ‘*Man topic*’. These buffers use a special major mode, Man mode, that facilitates scrolling and jumping to other manual pages. For details, type C-h m while in a man page buffer.

Each man page belongs to one of ten or more sections, each named by a digit or by a digit and a letter. Sometimes there are multiple man pages with the same name in different sections. To read a man page from a specific section, type ‘topic(section)’ or ‘section topic’ when M-x manual-entry prompts for the topic. For example, to read the man page for the C library function chmod (as opposed to a command of the same name), type M-x manual-entry <RET> chmod(2) <RET>. (chmod is a system call, so it is in section ‘2’.)

If you do not specify a section, the results depend on how the man program works on your system. Some of them display only the first man page they find. Others display all man pages that have the specified name, so you can move between them with the M-n and M-p keys(13). The mode line shows how many manual pages are present in the Man buffer.

By default, Emacs highlights the text in man pages. For a long man page, highlighting can take substantial time. You can turn off highlighting of man pages by setting the variable Man-fontify-manpage-flag to nil.

If you insert the text of a man page into an Emacs buffer in some other fashion, you can use the command M-x Man-fontify-manpage to perform the same conversions that M-x manual-entry does.

An alternative way of reading manual pages is the M-x woman command(14). Unlike M-x man, it does not run any external programs to format and display the man pages; instead it does the job in Emacs Lisp, so it works on systems such as MS-Windows, where the man program (and other programs it uses) are not generally available.

M-x woman prompts for a name of a manual page, and provides completion based on the list of manual pages that are installed on your machine; the list of available manual pages is computed automatically the first time you invoke woman. The word at point in the current buffer is used to suggest the default for the name the manual page.

With a numeric argument, M-x woman recomputes the list of the manual pages used for completion. This is useful if you add or delete manual pages.

If you type a name of a manual page and M-x woman finds that several manual pages by the same name exist in different sections, it pops up a window with possible candidates asking you to choose one of them.

For more information about setting up and using M-x woman, see WoMan: (woman)Top section `Browse UN*X Manual Pages WithOut Man' in The WoMan Manual.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.