bug-groff
[Top][All Lists]
Advanced

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

Re: Regressions in UTP document (was: removing the .IX macro from the ms


From: G. Branden Robinson
Subject: Re: Regressions in UTP document (was: removing the .IX macro from the ms package in 1.23 breaks old documents)
Date: Thu, 3 Oct 2024 21:49:40 -0500

[self-follow-up]

At 2024-10-03T20:53:05-0500, G. Branden Robinson wrote:
> At 2024-10-04T01:17:53+0100, Deri wrote:
> > > > Various problems occur using current git groff, from extra blank
> > > > pages, text which was set as mono spaced appearing as
> > > > Times-Roman, pdf bookmarks jumping to the wrong page, input line
> > > > numbers appearing in the output (1.0 postscript only - also
> > > > affects 1.23.0 - Ok in 1.22.4).
[...]
> > Only the visible line numbers issue is present in 1.23.0, the others
> > are current git only.
[...]
> That leaves the line numbering issue.  I'll have a look.

This appears to be related to a bug report from 2021.

commit 633de5c27e299ba9421ca8ba298a5bc90e56ff1c
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu Feb 25 17:28:43 2021 +1100

    Fix Savannah #59812.

    Fix bug where having line numbering off but the output line number
    register \n[ln] set to a positive value would cause tbl(1) table rows to
    spontaneously become numbered.  Use new \n[.nm] register to determine
    whether line numbering is enabled.

    * src/preproc/tbl/table.cpp (table::init_output, table::do_row,
      table::do_bottom): Predicate all conditions on \n[ln] additionally on
      \n[.nm].

    Thanks to Olle Lögdahl for the report.  Problem appears to date back to
    commit b69062693d3360efce9d4d63fac337be21e07db7, 20 July 2011.

    Fixes <https://savannah.gnu.org/bugs/?59812>.

commit b80434b3ebaef62fb8951c4b0b7c3de023742f1d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu Feb 25 15:08:56 2021 +1100

    Add regression test for Savannah #59812.

    * src/preproc/tbl/tests/cooperate-with-nm-request.sh: Do it.
    * src/preproc/tbl/tbl.am (tbl_TEST): Run test.

    Test will fail at this commit.

Some instrumentation of the document...

diff --git a/src/ch16.t b/src/ch16.t
index 15afdb0..6823d68 100644
--- a/src/ch16.t
+++ b/src/ch16.t
@@ -470,6 +470,14 @@ number registers by the
 macros.
 .page 486
 .ix macros, initializing
+.tm GBR1: ln=\n[ln], .nm=\n[.nm], .nn=\n[.nn]
+.als nm@real nm
+.rm nm
+.de nm
+.  tm GBR1: nm \\$@
+.  backtrace
+.  nm@real \\$@
+..
 .Ts "Number Registers Used in \f[CB]ms\fP"
 .TS
 center box tab (#);
@@ -494,6 +502,7 @@ Quoted paragraph indent#\f[CW]QI#5n##5n\fP
 Interparagraph spacing#\f[CW]PD#0.3v##1v\fP
 .TE
 .Te
+.tm GBR2: ln=\n[ln], .nm=\n[.nm], .nn=\n[.nn]
 .PP
 The
 .CW mm

...revealed the following:

GBR1: ln=12, nm=0, nn=0
GBR1: nm "12"
troff: backtrace: './ch16.t':478: macro 'nm'
troff: backtrace: file './ch16.t':536
GBR2: ln=0, nm=1, nn=0

(That "536" line number has nothing to do with anything, a smoking gun
for a problem buried in tbl(1) output before it can "fix up" the input
line numbers.)

Could be there was a logic error in my fix for #59812, and that my
regression test was inadequate.  I'll keep digging.

A workaround (I just tested it) is to stick

.nr ln 0

into this document before this table, and that may be necessary to
achieve correcting formatting of the 1.0 branch with groff 1.23.0, but I
assure you I want to fix any defect exposed in groff here.

It's odd, though--Olle's report observed the same problem _before_ groff
1.23.0...but I don't see it in this document either when rendering with
1.22.4 (the content moves to page 398).

The stale (but would-be harmless) value of `ln` clearly comes from the
section "Output Line Numbering" of chapter 15.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


reply via email to

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