groff
[Top][All Lists]
Advanced

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

Re: device-dependent warnings


From: G. Branden Robinson
Subject: Re: device-dependent warnings
Date: Sat, 6 May 2023 20:59:22 -0500

Hi Alex,

At 2023-05-03T00:21:33+0200, Alejandro Colomar wrote:
> On 5/2/23 17:10, G. Branden Robinson wrote:
> > There isn't really any such thing as a device-dependent warning,
> > unless you count those thrown by the output driver itself, like
> > grops(1) or grotty(1).
> 
> No, I run the output driver separately.  I'm talking about troff(1)
> specifically.  I'm seeing three kinds of warnings when running
> troff -man -Tutf8:
> 
> troff:man3/unlocked_stdio.3:123: warning [p 2, 1.8i, div '3tbd1,0', 0.3i]: 
> cannot break line

Okay, yes, that is termed an "output warning" internally, thus the weird
format.  But it's still not device-dependent.  Incidentally, the format
of the extra information has long bothered me.  So I have a change
pending for groff-next that will make the foregoing look more like:

troff:man3/unlocked_stdio.3:123: warning [page 2, 1.8i (diversion '3tbd1,0', 
0.3i)]: cannot break line

What would build upon this nicely would be:

1. For the man(7) and mdoc(7) packages to set the warning scaling
   indicator to "n" when formatting for terminals.  It's pretty useless
   to give terminal users a measurement in inches.  They'll need to
   learn that "n" is in screen lines, but once they have that, they
   stand some change of locating the position on the page being griped
   about.

2. Revising continuous rendering to use the "infinite"[1] page length
   approach with sudden death truncation at the end of the document.

After all the trouble I went to to get the bugs out of the existing
continuous rendering implementation, there will be a frisson to
deleting most of it.

> an.tmac:man4/cciss.4:164: style: blank line in input
> 
> man4/console_codes.4:324: warning: table wider than line length minus 
> indentation
> 
> I noticed some are prefixed by 'an.tman:', and I understand those are
> the CHECKSTYLE ones (or in general produced by the man(7) macro
> package).

Yes.

> Some others are prefixed by 'troff:'

Yes, those come from the formatter, troff(1).

> and others don't have a prefix at all.

They do: the document's file name.  The document is complaining about
itself.  You may protest that YOU didn't put that there.  And indeed you
didn't.  You gave tbl(1) permission to do so on your behalf.

> I inferred that there was a difference between the latter pair of
> groups of warnings, but maybe I'm wrong.  Why is there a difference?

The reason is that tbl itself isn't complaining; the *roff code it
generated and put into your document is.  And the reason for _that_ is
that at the time tbl ran, there wasn't a problem.  It was only when the
page was getting formatted that your document discovered that there was
a problem with the line length.

You could take the same output from tbl and format it on a wider
terminal, and the diagnostic would not be emitted because there wouldn't
be a problem.  Remember that when tbl runs, the document has not yet
been formatted.  tbl doesn't _know_ what the line length will be.

During the 1.23.0 development cycle I was careful to make sure all these
diagnostics injected into the document by tbl went to the trouble of
mentioning tables so the user might twig on to the fact that tbl was
(indirectly) involved.  See <https://savannah.gnu.org/bugs/?59443>.

Regards,
Branden

[1] not really infinite, just INT_MAX basic units long

Attachment: signature.asc
Description: PGP signature


reply via email to

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