[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #60598] tbl reports incorrect line numbers in diagnostics
From: |
G. Branden Robinson |
Subject: |
[bug #60598] tbl reports incorrect line numbers in diagnostics |
Date: |
Thu, 20 Jan 2022 07:28:47 -0500 (EST) |
User-agent: |
Lynx/2.8.9rel.1 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/3.6.7 |
Follow-up Comment #3, bug #60598 (project groff):
I think I've cracked it. I had been looking in the wrong place
for the problem; the right place was the injection of `ig`-nored
eqn(1) input to disable and re-enable delimiters to prevent that
program from interfering with production of diagnostic messages.
Unfortunately, these injections were performed _after_ the
`set_location()` function (which ultimately writes `lf`
requests) was called, which is why the line numbers were
consistently off by 5--that's how long the `ig`-nored region
was.
Here's an exercise of the format-time diagnostic messages with
minimal inputs, with output of groff 1.22.4, and then with groff
Git HEAD, with my patch applied to fix this stuff.
These cases are exercised in a unit test also pending a push, so
don't take them too literally (i.e., there are some tab
characters that might not survive the trip through
Savannah/email).
$ cat EXPERIMENTS/tbl-diagnostic-1a.groff
.pl 2v
.TS
L.
T{
.nf
1
2
3
T}
.TE
$ groff -tz EXPERIMENTS/tbl-diagnostic-1a.groff
warning: page 2: table text block will not fit on one page
$ ./build/test-groff -tz EXPERIMENTS/tbl-diagnostic-1a.groff
EXPERIMENTS/tbl-diagnostic-1a.groff:4: warning: table row will not fit on page
2
$ cat EXPERIMENTS/tbl-diagnostic-1b.groff
.pl 2v
.vs 3v
.TS
L.
1
.TE
$ groff -tz EXPERIMENTS/tbl-diagnostic-1b.groff
warning: page 2: table text block will not fit on one page
$ ./build/test-groff -tz EXPERIMENTS/tbl-diagnostic-1b.groff
EXPERIMENTS/tbl-diagnostic-1b.groff:4: warning: table row will not fit on page
2
$ cat EXPERIMENTS/tbl-diagnostic-2.groff
.pl 2v
.vs 3v
.TS
box;
L.
1
.TE
$ groff -tz EXPERIMENTS/tbl-diagnostic-2.groff
error: page 2: table will not fit on one page; use .TS H/.TH with a supporting
macro package
$ ./build/test-groff -tz EXPERIMENTS/tbl-diagnostic-2.groff
EXPERIMENTS/tbl-diagnostic-2.groff:5: error: boxed table will not fit on page
2; use .TS H/.TH with a supporting macro package
$ cat EXPERIMENTS/tbl-diagnostic-3.groff
.pl 2v
.ll 10n
.br
.TS
L.
12345678901
.TE
$ groff -tz EXPERIMENTS/tbl-diagnostic-3.groff
warning: file 'EXPERIMENTS/tbl-diagnostic-3.groff', around line 11:
table wider than line width
$ ./build/test-groff -tz EXPERIMENTS/tbl-diagnostic-3.groff
EXPERIMENTS/tbl-diagnostic-3.groff:6: warning: table wider than line length
minus indentation
$ cat EXPERIMENTS/tbl-diagnostic-4.groff
.pl 3v
.ll 10n
.TS
expand;
L L.
abcde fghij
.TE
$ groff -tz EXPERIMENTS/tbl-diagnostic-4.groff
warning: file 'EXPERIMENTS/tbl-diagnostic-4.groff', around line 11:
table wider than line width
warning: file 'EXPERIMENTS/tbl-diagnostic-4.groff', around line 6:
table squeezed horizontally to fit line length
$ ./build/test-groff -tz EXPERIMENTS/tbl-diagnostic-4.groff
EXPERIMENTS/tbl-diagnostic-4.groff:6: warning: table column separation reduced
to fit line length
$ cat EXPERIMENTS/tbl-diagnostic-5.groff
.pl 3v
.ll 10n
.TS
expand;
L L.
abcd efgh
.TE
$ groff -tz EXPERIMENTS/tbl-diagnostic-5.groff
warning: file 'EXPERIMENTS/tbl-diagnostic-5.groff', around line 11:
table wider than line width
warning: file 'EXPERIMENTS/tbl-diagnostic-5.groff', around line 6:
table squeezed horizontally to fit line length
$ ./build/test-groff -tz EXPERIMENTS/tbl-diagnostic-5.groff
EXPERIMENTS/tbl-diagnostic-5.groff:6: warning: table column separation reduced
to fit line length
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60598>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/