unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Xah <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How do I decode an NROFF file for viewing?
Date: Sat, 19 Jul 2008 13:39:27 -0700 (PDT)	[thread overview]
Message-ID: <8438fb2d-677c-497f-9214-78339f72475f@b2g2000prf.googlegroups.com> (raw)
In-Reply-To: g5tajo$28he$1@colin2.muc.de

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
know:

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 n43921.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”.


http://xahlee.org/UnixResource_dir/unix_tips.html

  Xah
∑ http://xahlee.org/

  reply	other threads:[~2008-07-19 20:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-19 18:08 How do I decode an NROFF file for viewing? Alan Mackenzie
2008-07-19 20:39 ` Xah [this message]
2008-07-23  1:01 ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8438fb2d-677c-497f-9214-78339f72475f@b2g2000prf.googlegroups.com \
    --to=xahlee@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).