groff
[Top][All Lists]
Advanced

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

Re: [Groff] bug in version 1.18


From: Werner LEMBERG
Subject: Re: [Groff] bug in version 1.18
Date: Sun, 01 Dec 2002 17:30:16 +0100 (CET)

> > One other thing, is there a way to do GROFF_NO_SGR in the roff
> > source, like
> >     .nr sgr 0
> > 
> > or something?
> > 
> *sigh*
> 
> Please see the ``Disabling SGR in grotty(1): gory details'' thread
> in this mailing list that took place in October.

:-)

This is quite tricky due to some internal limitations of groff.  Below
a macro solution which should work (to be appended to troffrc).
Additionally, there was a bug in the implementation of the \n[.trunc]
register (which apparently noone has ever used since the very day
James Clark has written it) so that you need the current CVS of groff
for full functionality.  In most cases, groff 1.18.1 will work also.



     Werner

======================================================================

.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]