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

Re: Pipe man page as ASCII text



On Fri, Nov 22, 2002 at 12:32:08AM +0000, Colin Watson wrote:
> On Thu, Nov 21, 2002 at 02:55:05PM -0800, Osamu Aoki wrote:
> > On Thu, Nov 21, 2002 at 12:36:31PM -0800, Bill Moseley wrote:
> > > How can I mail an ASCII version of a man page?
> > 
> > I know most answer gven here were correct for Woody but may not be 
> > in Sarge.
> > 
> > Chck out GROFF_NO_SGR=1 Since groff (backbone of man) changed a bit
> 
> This is true in general. However, unless you've been messing around with
> /etc/groff/{man,mdoc}.local, SGR escapes are already disabled for man
> pages.

Er, to try to clarify matters for those not intimately familiar with
groff:

SGR escape sequences are used by newer versions of groff (1.18 and
above) instead of the traditional backspace hacks for bold and
underline, and also implement colour support. They mean that you can
just dump a man page to ANSI-compliant terminals rather than a pager and
get bold, underline, and colour effects; also, more importantly, they
work much better with Unicode.

However, many pagers have rather serious problems displaying SGR
escapes, so I made the decision to turn them off by default where I
could, in other words in manual pages (using /etc/groff/{man,mdoc}.local
as mentioned above). When they're off, the traditional 'col -b'
technique to remove the backspacings for bold and underline formatting
can be used. To override this and use the ANSI-style escape sequences,
set GROFF_SGR=1 in your environment.

If you have problems with unwanted SGR escapes in manual pages, check
whether you accepted the groff-base package's changes to the
configuration files in /etc/groff. If you have problems with unwanted
SGR escapes appearing in preformatted text files shipped in packages
(you'll see things like "^[1m"), check whether they were generated by
groff and then consider filing a bug against those packages to set
GROFF_NO_SGR=1 in their build process.

I believe that the FreeBSD groff folks have come up with a trick to turn
SGR escapes off everywhere, rather than just in manual pages. If I can
figure out how it works, I'll consider incorporating it into Debian.

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: