File: man.el.html

This code provides a function, man, with which you can browse UNIX manual pages. Formatting is done in background so that you can continue to use your Emacs while processing is going on.

The mode also supports hypertext-like following of manual page SEE ALSO references, and other features. See below or do ? in a manual page buffer for details.

========== Credits and History ==========
In mid 1991, several people posted some interesting improvements to man.el from the standard Emacs 18.57 distribution. I liked many of these, but wanted everything in one single package, so I decided to incorporate them into a single manual browsing mode. While much of the code here has been rewritten, and some features added, these folks deserve lots of credit for providing the initial excellent packages on which this one is based.

Nick Duffek <duffek@chaos.cs.brandeis.edu>, posted a very nice improvement which retrieved and cleaned the manpages in a background process, and which correctly deciphered such options as man -k.

Eric Rose <erose@jessica.stanford.edu>, submitted manual.el which provided a very nice manual browsing mode.

This package was available as superman.el from the LCD package for some time before it was accepted into Emacs 19. The entry point and some other names have been changed to make it a drop-in replacement for the old man.el package.

Francesco Potortì <pot@cnuce.cnr.it> cleaned it up thoroughly, making it faster, more robust and more tolerant of different systems' man idiosyncrasies.

========== Features ==========
+ Runs "man" in the background and pipes the results through a
  series of sed and awk scripts so that all retrieving and cleaning
  is done in the background. The cleaning commands are configurable.
+ Syntax is the same as Un*x man
+ Functionality is the same as Un*x man, including "man -k" and
  "man <section>", etc.
+ Provides a manual browsing mode with keybindings for traversing
  the sections of a manpage, following references in the SEE ALSO
  section, and more.
+ Multiple manpages created with the same man command are put into
  a narrowed buffer circular list.

============= TODO ===========
- Add a command for printing.
- The awk script deletes multiple blank lines. This behavior does
  not allow one to understand if there was indeed a blank line at the
  end or beginning of a page (after the header, or before the
  footer). A different algorithm should be used. It is easy to
  compute how many blank lines there are before and after the page
  headers, and after the page footer. But it is possible to compute
  the number of blank lines before the page footer by heuristics
  only. Is it worth doing?
- Allow a user option to mean that all the manpages should go in
  the same buffer, where they can be browsed with M-n and M-p.

Defined variables (55)

Man-ansi-color-basic-faces-vectorThe value used here for ‘ansi-color-basic-faces-vector’.
Man-ansi-color-mapThe value formerly used here for ‘ansi-color-map’.
Man-apropos-regexpRegular expression describing a reference to manpages in "man -k output".
Man-awk-commandProgram used by ‘man’ to process awk scripts.
Man-berkeley-sed-scriptScript for berkeley-like sed to nuke backspaces and ANSI codes from manpages.
Man-circular-pages-flagNon-nil means the manpage list is treated as circular for traversal.
Man-coding-systemCoding-system to decode output from the commands run by ‘man’.
Man-completion-cacheCache of completion table of the form (PREFIX . TABLE).
Man-cooked-hookHook run after removing backspaces but before ‘Man-mode’ processing.
Man-downcase-section-letters-flagNon-nil means letters in sections are converted to lower case.
Man-file-name-regexpRegular expression describing <> in #include line (directive of cpp).
Man-files-regexpRegular expression for FILES heading (or your equivalent).
Man-filter-listManpage cleaning filter command phrases.
Man-first-heading-regexpRegular expression describing first heading on a manpage.
Man-fontify-manpage-flagNon-nil means make up the manpage with fonts.
Man-frame-parametersFrame parameter list for creating a new frame for a manual page.
Man-header-file-pathC Header file search path used in Man.
Man-header-regexpRegular expression describing references to header files.
Man-heading-regexpRegular expression describing a manpage heading entry.
Man-hyphenated-reference-regexpRegular expression describing a reference in the SEE ALSO section.
Man-include-regexpRegular expression describing the #include (directive of cpp).
Man-man-k-use-anchorIf non-nil prepend ^ to the prefix passed to "man -k" for completion.
Man-mode-abbrev-tableAbbrev table for ‘Man-mode’.
Man-mode-hookHook run when Man mode is enabled.
Man-mode-mapKeymap for Man mode.
Man-mode-syntax-tableSyntax table used in Man mode buffers.
Man-name-local-regexpRegexp that matches the text that precedes the command’s name.
Man-name-regexpRegular expression describing the name of a manpage (without section).
Man-normal-file-prefix-regexpRegular expression describing a file path appeared in FILES section.
Man-normal-file-regexpRegular expression describing references to normal files.
Man-notify-methodSelects the behavior when manpage is ready.
Man-page-header-regexpRegular expression describing the heading of a page.
Man-reference-regexpRegular expression describing a reference to another manpage.
Man-section-regexpRegular expression describing a manpage section within parentheses.
Man-section-translations-alistAssociation list of bogus sections to real section numbers.
Man-sed-commandProgram used by ‘man’ to process sed scripts.
Man-sed-scriptScript for sed to nuke backspaces and ANSI codes from manpages.
Man-see-also-regexpRegular expression for SEE ALSO heading (or your equivalent).
Man-specified-section-optionOption that indicates a specified a manual section name.
Man-support-local-filenamesInternal cache for the value of the function ‘Man-support-local-filenames’.
Man-switchesSwitches passed to the man command, as a single string.
Man-synopsis-regexpRegular expression for SYNOPSIS heading (or your equivalent).
Man-sysv-sed-scriptScript for sysV-like sed to nuke backspaces and ANSI codes from manpages.
Man-topic-historyTopic read history.
Man-untabify-commandProgram used by ‘man’ for untabifying.
Man-untabify-command-argsList of arguments to be passed to ‘Man-untabify-command’ (which see).
Man-uses-untabify-flagNon-nil means use ‘untabify’ instead of ‘Man-untabify-command’.
Man-widthNumber of columns for which manual pages should be formatted.
Man-width-maxMaximum number of columns allowed for the width of manual pages.
man-common-abbrev-tableAbbrev table for ‘man-common’.
man-common-hookHook run after entering Man Shared mode.
man-common-mapKeymap for ‘man-common’.
man-common-syntax-tableSyntax table for ‘man-common’.
man-imenu-titleThe title to use if man adds a Contents menu to the menubar.
manual-programProgram used by ‘man’ to produce man pages.

Defined functions (48)

Man--window-state-change(WINDOW)
Man-bgproc-filter(PROCESS STRING)
Man-bgproc-sentinel(PROCESS MSG)
Man-bookmark-jump(BOOKMARK)
Man-bookmark-make-record()
Man-build-man-command()
Man-build-page-list()
Man-build-references-alist()
Man-build-section-list()
Man-cleanup-manpage(&optional INTERACTIVE)
Man-completion-table(STRING PRED ACTION)
Man-default-bookmark-title()
Man-default-man-entry(&optional POS)
Man-find-section(SECTION)
Man-fit-to-window(WINDOW)
Man-follow-manual-reference(REFERENCE)
Man-fontify-manpage()
Man-getpage-in-background(TOPIC)
Man-goto-page(PAGE &optional NOERROR)
Man-goto-section(SECTION)
Man-goto-see-also-section()
Man-highlight-references(&optional XREF-MAN-TYPE)
Man-highlight-references0(START-SECTION REGEXP BUTTON-POS TARGET TYPE)
Man-init-defvars()
Man-kill()
Man-make-page-mode-string()
Man-mode()
Man-next-manpage()
Man-next-section(N)
Man-notify-when-ready(MAN-BUFFER)
Man-page-from-arguments(ARGS)
Man-parse-man-k()
Man-possibly-hyphenated-word()
Man-previous-manpage()
Man-previous-section(N)
Man-start-calling(&rest BODY)
Man-strip-page-headers()
Man-support-local-filenames()
Man-translate-cleanup(STRING)
Man-translate-references(REF)
Man-unindent()
Man-update-manpage()
Man-view-header-file(FILE)
Man-xref-button-action(BUTTON)
man(MAN-ARGS)
man-common()
man-follow(MAN-ARGS)
manual-entry(MAN-ARGS)

Defined faces (3)

Man-overstrikeFace to use when fontifying overstrike.
Man-reverseFace to use when fontifying reverse video.
Man-underlineFace to use when fontifying underlining.