[Top][All Lists]

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

[Groff] Re: incompatible change in groff 1.18

From: Werner LEMBERG
Subject: [Groff] Re: incompatible change in groff 1.18
Date: Wed, 26 Mar 2003 10:02:29 +0100 (CET)

> A change made in groff 1.18 that was not in 1.17.2 has broken
> TkMan and xman and other tools that process formatted manual pages.

8 months ago...  Latest groff is 1.18.1, and 1.18.2 will be out soon.

> groff has changed the way bold and italic characters are marked in
> -Tlatin1 from backspace-overstrike to escape-[-xxx.  At this late
> date in the history of [tng]roff, when most people use it only for
> formatting manual pages, in my opinion compatibility should take
> precedence over a slightly more space efficient method (which I
> assume is the reason for the change, no?).

First of all, it was not done for space savings but to support colors.
Second, SGR escape sequences for changing text attributes is what all
modern terminals like Linux consoles or xterm support natively (even
MS-DOS supports it with the ansi.sys driver).  `less' has been adapted
also meanwhile.  The ugly backspace-overstrike trick is a hack with
some severe drawbacks (which you certainly know) -- especially
grotty's UTF-8 support doesn't work reliably without SGR.

> Please restore the -Tlatin1 option to producing the
> backspace-overstrike as before, and enable the esc-[-xxx to another
> option with another flag.

There was some discussion on the list whether I shall do that, but I
finally decided to make the new behaviour the default, thus putting
slight pressure on other packages to be updated.

If you don't have the time to do that (or in the sad case you oppose
to support SGR at all) there are several possibilities to make groff
work as before (and indeed most distributions use one or another
method for that):

  . Set the environment variable `GROFF_NO_SGR'.

  . Pass option `-c' to grotty.

  . Append the code at the end of this mail to man.local (needs the
    current CVS snapshot due to a bug of the \n[.trunc] register in
    earlier versions of GNU troff).



.if n \{\
.  nr _C \n(.C
.  cp 0
.  \" The following code sets a top-of-page trap to disable grotty's TTY
.  \" mode.  Since neither \X nor .output can be used before the first
.  \" page has started, we must use a trap.  To make it work with troff's
.  \" -o option, we wait until the first printed page.
.  de address@hidden
.  .
.  rn wh address@hidden
.  \" The stand-alone version.  If no other trap is set, we can safely
.  \" insert the truncated vertical space caused by the trap (if any).
.  \" Otherwise we assume that the document's main macro package takes
.  \" care of that.  As soon as the trap has been executed, it is removed.
.  de1 address@hidden
.    if \\n[.P] \{\
.      if (\\n[.t] == \\n[.p]) \{\
.        rn address@hidden wh
.        rm address@hidden
.        wh 0
.        sp \\n[.trunc]
.        nop \X'tty: sgr 0'
.        sp -1
.    \}\}
.  .
.  address@hidden 0 address@hidden
.  \" The piggyback version to be appended to macros planted with the
.  \" modified `wh' request.
.  de1 address@hidden
.    if \\n[.P] \{\
.      rn address@hidden wh
.      ds address@hidden
.      nop \X'tty: sgr 0'
.      sp -1
.    \}
.  .
.  \" We redefine the `wh' request so that address@hidden' is appended to
.  \" the trap macro.
.  de1 wh
.    am1 \\$2 address@hidden
.      address@hidden
.    address@hidden
.    address@hidden \\$1 \\$2
.  .
.  cp \n[_C]

reply via email to

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