[Top][All Lists]

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

Re: [Groff] horizontal trap

From: Peter Schaffter
Subject: Re: [Groff] horizontal trap
Date: Sun, 27 Dec 2015 13:38:01 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Dec 26, 2015, Dave wrote:
> Here's what I'm trying to do.  I have a lengthy input file to be
> processed in no-fill mode.  For 99% of this file, that will work
> just fine: that is, the input lines will fit within the the page.
> A few lines, however, are too long for the page, and in no-fill
> mode groff happily sends them past the margin and even past the
> edge of the paper.
> I don't want groff to handle these lines; the exact way each such
> line should be handled depends on a number of factors and really
> requires manual intervention.  But I do want groff to alert me to
> such cases, so that I know where to find them without having to
> flip through a couple hundred pages of output.

Since you're in no-fill mode, it's a perfect job for the little-used
input line trap request.  This should do what you want.

.de foo
. it 1 bar
. di baz
.de bar
. di
. if \\n[dl]>\\n[.l] \
.   tm Line \\n[.c] exceeds width.
. baz
. foo
.de bat
.em bat
.ll 4i
First line of text.
Second line of text.

Any line exceeding 4i will be reported.  The .em (bat) prevents
groff from complaining about the final diversion being incomplete.

Peter Schaffter

reply via email to

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