[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: device-dependent warnings
From: |
Alejandro Colomar |
Subject: |
Re: device-dependent warnings |
Date: |
Sun, 7 May 2023 22:42:05 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 |
On 5/7/23 03:59, G. Branden Robinson wrote:
> 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.
Understood.
$ make build-pre-tbl >/dev/null
$ grep 'table wider' .tmp/man/man4/console_codes.4.eqn
. tm1 " table wider than line length minus indentation
. tm1 " table wider than line length minus indentation
. tm1 " table wider than line length minus indentation
. tm1 " table wider than line length minus indentation
. tm1 " table wider than line length minus indentation
. tm1 " table wider than line length minus indentation
. tm1 " table wider than line length minus indentation
. tm1 " table wider than line length minus indentation
. tm1 " table wider than line length minus indentation
BTW, tbl(1) doesn't accept any warnings flags. Is this warning
unconditional?
>
>> 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.
Seems reasonable.
> It was only when the
> page was getting formatted that your document discovered that there was
> a problem with the line length.
That's what I consider a device-dependent warning. In HTML, there will
probably be no limits to the right margin. In PDF and PS, the margin
will be at a point depending on the font size and paper size. And in
UTF8 and ASCII, it will depend on LL.
It's good to know that these warnings are independent of -ww, so that
I can remove -ww from troff -Tps and still get these.
Is there any warning from troff(1) (or any of the programs; not the doc
itself) that depend on the output like this one?
Probably the following one one?
troff:man2/s390_sthyi.2:124: warning [p 2, 1.8i]: cannot adjust line
Probably the ones you call "output warnings". Then it might be
interesting to have an "output" warning category?
>
> 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>.
Thanks!
>
> Regards,
> Branden
>
> [1] not really infinite, just INT_MAX basic units long
Heh, next thing I'll try is a document that long. ;-)
Cheers,
Alex
--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
OpenPGP_signature
Description: OpenPGP digital signature
- Re: device-dependent warnings, G. Branden Robinson, 2023/05/02
- Re: device-dependent warnings, G. Branden Robinson, 2023/05/06
- Re: device-dependent warnings,
Alejandro Colomar <=
- Re: device-dependent warnings, G. Branden Robinson, 2023/05/07
- Re: device-dependent warnings, Alejandro Colomar, 2023/05/08
- Re: device-dependent warnings, Alejandro Colomar, 2023/05/09
- Re: device-dependent warnings, Dave Kemper, 2023/05/09
- Re: device-dependent warnings, G. Branden Robinson, 2023/05/10
- Re: device-dependent warnings, Dave Kemper, 2023/05/10
- Re: device-dependent warnings, Dave Kemper, 2023/05/10
- units used in `ss` request (was: device-dependent warnings), G. Branden Robinson, 2023/05/13
- Re: units used in `ss` request (was: device-dependent warnings), G. Branden Robinson, 2023/05/13
- Re: units used in `ss` request (was: device-dependent warnings), Dave Kemper, 2023/05/13