groff
[Top][All Lists]
Advanced

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

[Groff] No-space mode in diversions


From: Tadziu Hoffmann
Subject: [Groff] No-space mode in diversions
Date: Thu, 3 May 2001 08:29:05 +0200

Hi!

The troff user's manual states that no-space mode is associated
with the current diversion, and Unix troff behaves accordingly.
GNU troff currently implements no-space mode only for the
top-level diversion.  Anybody interested in a quick fix?

Anyhow, here's some troff input for testing:
(test with nroff -Ttn300 or groff -Tascii)
----------------------------------------------------------------
.pl 20v
.vs 2v
.di xx
foo
.sp 3v
bar
.br
.ns
.sp 3v
baz
.br
.di
.nf
.xx
----------------------------------------------------------------
(Of course it doesn't work in the current version of groff because
the code to handle it is not there.  Unix nroff shows interesting
behavior: if you remove the `.br' after `bar' in this sample code,
it behaves as if the `.ns' were completely ineffective.  Probably
because `.sp' generates a break, causing `bar' to be output, which
turns no-space mode off, after which `.sp' is allowed to space.
Is this interpretation correct?  Does it make sense to act this
way?  I think it would have been nicer if `.sp' caused a break,
but threw away its arguments while still in no-space mode.)


Also, I think we should have a number register to query
no-space mode.  I suggest `.q' (in analogy to `.u') to give
`1' in no-space mode and `0' in (default) normal mode.
Comments?


Cheers,
Tadziu

reply via email to

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