[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I decode an NROFF file for viewing?

From: Xah
Subject: Re: How do I decode an NROFF file for viewing?
Date: Sat, 19 Jul 2008 13:39:27 -0700 (PDT)
User-agent: G2/1.0

Alan Mackenzie wrote:

> The M-x man command does 2 things:
> (i) It finds the pertinent file using complicated, difficult, and
>   obscure algorithms;
> (ii) It converts the markup stuff in the file to a readable form and
>   displays it.
> I have an Nroff file, mount.8, loaded into Emacs.  How do I do part
> (ii) of the above, and get it nicely displayed?

possibly others have elisp answers on the spot. But here's what i

you can use WoMan to read man pages in emacs. The manual-entry command
calls shell tool to do its job. WoMan is written entirely in elisp.
So, this means you could lookup WoMan's source code to see what it
does if you need it.

Alternative solution is to call shell command to process it first then
display the result plain text file in emacs. Here's some tips i wrote
some 10 years ago:

• How to get a text output of a man page?

“man ls | col -b”. The “col -b” formats the man page to plain text
(rid of control chars).

• How to read a non-compressed man page without the “man” command?

“nroff -man | col -b”

• This is convenient when you need to read a man-page file once
without adding the dir to your $MANPATH.

• How to read a compressed man page without the “man” command?

“cat n43921.1 | compress -cd - | nroff -man | col -b”

• How to read a unformatted man page?

a possible solution: “nroff -man ftpshut.8”

The “man” command is essentially “nroff -e -man file_name | more -s”.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]