man pages and highlighting etc

Glenn Herteg iapsd!hopi!glenn at uunet.uu.net
Fri Apr 19 01:30:00 AEST 1991


In Sun-Spots v10n69, pearmana at prl.philips.co.uk writes:
[... bold and underlining from nroff don't show up ...]

I have modified my local copies of "man" and "catman" in the following
ways, by appropriate use of a binary editor:

The version of "man" differs from the standard SunOS 4.x version in that
it invokes "nroff -Tsun" instead of "nroff -Tlpr" when it formats manual
pages for a terminal device.  This terminal specification is used in
conjunction with a user-written "nroff" terminal-driving table called
"/usr/lib/term/tabsun", written for the SunView environment.  Use of this
table forces "nroff" to insert the correct escape sequences so boldface
characters appear as such in a SunView tty window, such as the one used by
"shelltool".  This version of "man" also changes the "-t" flag given to
troff (or the command specified with the TROFF environment variable) to
"-p", the equivalent flag accepted by eroff.

The version of "catman" differs from the standard SunOS 4.x version in
that, like the local "man", it invokes "nroff -Tsun" instead of "nroff
-Tlpr".

These fixes are used in conjunction with

setenv PAGER "more -c -f -s"

in my .login or .cshrc file, and modifications to the -man macros to
change the page width to 7.5i for nroff-formatted documents, and to change
the page length for nroff-formatted documents to 100i.  These changes to
the standard -man macros allow more of the manual page to fit across a
standard window, and they get rid of almost all those annoying header and
footer lines appearing in the middle of your screen.  Why Sun never
thought of this I'll never know; certainly the only reason to use nroff is
for terminal display, not for actual printing.

Finally, I have

/Tty/Bold_style "Offset_X"

in my .defaults file.  This allows boldface to actually show up as such.
Italics show up as underlined text automatically, as long as you have
/Tty/Underline_mode Enabled (this seems to be the default if you have
no similar line in your .defaults file).

This solution is not perfect, but it comes close.  It lets me preview my
manual pages on the screen as I write them, so I don't waste lots of paper
to get most formatting and fonts right.  There are a number of minor
glitches I wish Sun would fix, but there's not a snowball's ...  well,
they've moved on to OpenWindows and other pursuits.  I haven't yet tried
to set up the equivalent structure there.

Once this was all set up, I ran catman on all the standard Sun manual
pages, so everybody gets to take advantage of these improvements.  Also,
any new manual pages I write automatically get formatted cleanly, and
stored away in the cat? directories for future reference.

I wish I could coax Sun into supporting ditroff, -mm, man, and kin in a
completely clean way, to avoid all this trouble.  They are way behind the
current versions of these programs.  Does no one within Sun ever look at
on-line manual pages?



More information about the Comp.sys.sun mailing list