[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #59812] tbl: interferes with .nm line numbering
From: |
G. Branden Robinson |
Subject: |
[bug #59812] tbl: interferes with .nm line numbering |
Date: |
Tue, 23 Feb 2021 12:25:26 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 |
Follow-up Comment #3, bug #59812 (project groff):
I think the problem here is, as with ".na" and ".ad l", non-orthogonality of
internal state inspection windows. It is compounded in this case by the fact
that there are few registers that permit introspection of output line
numbering configuration. The only one available is \(ln, from Unix troff, and
which encodes the output line number itself.
However, GNU tbl is testing \(ln to see if output line numbering is
_enabled_.
See src/preproc/tbl/table.cpp:table::init_output().
1817 ".de " REPEATED_NM_SET_MACRO "\n"
1818 ".ie !'\\n(.z'' \\{.nm\n"
1819 "\\!." REPEATED_NM_SET_MACRO " \"\\$1\"\n"
1820 ".\\}\n"
1821 ".el .if \\n[ln] \\{\\\n"
1822 ".if '\\$1'd' .nr " ROW_START_LINE_REG " \\n[ln]\n"
1823 ".if '\\$1's' .nm \\n[" ROW_START_LINE_REG "]\n"
1824 ".if '\\$1'm' .nr " ROW_MAX_LINE_REG " \\n[ln]>?\\n["
ROW_MAX_LINE_REG "]\n"
1825 ".\\}\n"
1826 "..\n"
1827 ".de " REPEATED_NM_SUS_MACRO "\n"
1828 ".ie !'\\n(.z'' \\{.nm\n"
1829 "\\!." REPEATED_NM_SUS_MACRO " \"\\$1\"\n"
1830 ".\\}\n"
1831 ".el .if \\n[ln] \\{\\\n"
1832 ".ie '\\$1's' \\{\\\n"
1833 ".nr " ROW_SAVE_LINE_REG " \\n(ln<?\\n[" ROW_MAX_LINE_REG "]\n"
1834 ".nm +0 \\n[ln]+42\n"
1835 ".\\}\n"
1836 ".el \\{\\\n"
1837 ".nr ln \\n[" ROW_SAVE_LINE_REG "]\n"
1838 ".nm \\n[ln] 1\n"
1839 ".\\}\n"
1840 ".\\}\n"
1841 "..\n");
There's some other stuff doing on here with a diversion named ".nm" that I
don't completely understand yet, but I think I'm getting warmer.
Also I wonder what that magic constant "42" on line 1834 is about.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?59812>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/