At 2020-11-16T01:10:36+0100, Olle Lögdahl wrote: > I'm experiencing a weird bug using .nm and tbl. If there is a single > call to .nm which has at least 1 argument, all rows in tbl get > numbered, even after .nm is reset. I attached a minimal test. Please > tell me if I got something wrong.
I believe you have found a bug, but there are a couple of problems with
your reproducer.
1. It uses DOS line endings, which annoys GNU troff.
2. You specified an invalid spacing argument of "0" to the .nm request.
However, remedying these does not change the fundamental misbehavior.
It does indeed seem that .nm gets "magically" turned back on for the
table. Interestingly, if numbering is suppressed for several lines
with, approximately, ".nn 7" (or more) instead of ".nm", the problem
goes away.
Heirloom Doctools tbl/nroff does not exhibit the problem, but its tbl
handles the "allbox" table option unusably badly. (Nice to see a bug in
someone _else's_ roff for a change.) In any case, removing "allbox"
does not suppress the bug, so we don't need it for the reproducer.
I also note, to my surprise, that the roff that GNU tbl emits uses .nm
itself[1]. I begin to wonder if there is an environment problem.
Apparently using .nm yourself creates a latent issue that is awakened by
a subsequent table.
I'm attaching a more minimal reproducer, as well as rendered output as
text files with embedded SGR escapes. But not maximally minimal.
The .TL is not necessary but I'm keeping it because it reveals a
difference in vertical spacing between Heirloom Doctools ms and groff
ms. I don't know if that is important. Does anyone have any opinions
on this?
Someone besides me wanna RCA this? I feel like my plate is pretty full
for 1.23.0 already (admittedly, it's heaped with my own choices from the
buffet, so I have only myself to blame :) ).
Regards,
Branden
[1] See
src/preproc/tbl/table.cpp:table::init_output(),table::do_bottom().
[2] The parity for padding when adjusting to both margins is also
different--groff pads line #2 from the right, and Heirloom pads the
same line from the left. But it's pretty hard for me to consider
that a bug.
tbl-with-nm.ms
Description: Troff MS-macros document
[1mTitle[0m
1 This text is requested to be numbered line by line. Hope it
2 works correctly. We need more lines. Keep on filling it
up. Yes now you see the effect.
You see, all text beyond here is not numbered.
3 a 1
4 b 2
5 c 3
[1mTitle[0m
1 This text is requested to be numbered line by line. Hope it
2 works correctly. We need more lines. Keep on filling it
up. Yes now you see the effect.
You see, all text beyond here is not numbered.
a 1
b 2
c 3
November 16, 2020
signature.asc
Description: PGP signature
