gbranden pushed a commit to branch master in repository groff. commit 2780ea875f20a399739de658b2cb55c42a676fe4 Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Wed Aug 20 11:39:52 2025 -0500
[hdtbl]: Continue fixing Savannah #52463. * contrib/hdtbl/hdtbl.tmac: Define new `hdtbl` string containing the (canonical) file name of the macro package, so that it can announce itself in diagnostic messages. * contrib/hdtbl/hdmisc.tmac (t*EM): * contrib/hdtbl/hdtbl.tmac (TBL, CPTN, TR, TH, TD, ETB, t*free, t*cl) (t*dntr, t*args, t*hm): Prefix diagnostic messages with it. Continues fixing <https://savannah.gnu.org/bugs/?52463>. --- contrib/hdtbl/ChangeLog | 12 +++++ contrib/hdtbl/hdmisc.tmac | 14 +++--- contrib/hdtbl/hdtbl.tmac | 113 ++++++++++++++++++++++++++++------------------ 3 files changed, 89 insertions(+), 50 deletions(-) diff --git a/contrib/hdtbl/ChangeLog b/contrib/hdtbl/ChangeLog index bd020b747..57e1c1341 100644 --- a/contrib/hdtbl/ChangeLog +++ b/contrib/hdtbl/ChangeLog @@ -1,3 +1,15 @@ +2025-08-20 G. Branden Robinson <g.branden.robin...@gmail.com> + + * hdtbl.tmac: Define new `hdtbl` string containing the + {canonical} file name of the macro package, so that it can + announce itself in diagnostic messages. + + * hdmisc.tmac (t*EM): + * hdtbl.tmac (TBL, CPTN, TR, TH, TD, ETB, t*free, t*cl, t*dntr) + (t*args, t*hm): Prefix diagnostic messages with it. + + Continues fixing <https://savannah.gnu.org/bugs/?52463>. + 2025-08-20 G. Branden Robinson <g.branden.robin...@gmail.com> * hdtbl.tmac (TH): Confirm (just as `TR` does) that macro usage diff --git a/contrib/hdtbl/hdmisc.tmac b/contrib/hdtbl/hdmisc.tmac index 298bc8cc0..6df2d782a 100644 --- a/contrib/hdtbl/hdmisc.tmac +++ b/contrib/hdtbl/hdmisc.tmac @@ -304,15 +304,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. .de t*EM . . if !"\\*[t*kept]"" \{\ -. tm1 "hdtbl: Not all tables have been printed. -. tm1 " Add '.bp' at the end of your document. +. tmc \*[hdtbl]: Not all tables have been printed. +. tm1 " Add '.bp' at the end of your document. . \} . if !"\\*[t*held]"" \{\ -. tm1 "hdtbl: There are held tables which haven't been printed. -. tm1 " Add '.t*free' at the end of your document. +. tmc \*[hdtbl]: There are held tables which haven't been printed. +. tm1 " Add '.t*free' at the end of your document. +. \} +. if \\n[t*#] \{\ +. tmc \*[hdtbl]: Missing '.ETB' macro; last .TBL in \\*[t*FN] at line +. tm1 " \\*[t*LN]. . \} -. if \\n[t*#] \ -. tm hdtbl: Missing '.ETB' macro; last .TBL in \\*[t*FN] at line \\*[t*LN]. .. . . diff --git a/contrib/hdtbl/hdtbl.tmac b/contrib/hdtbl/hdtbl.tmac index e901a22b2..9504a5112 100644 --- a/contrib/hdtbl/hdtbl.tmac +++ b/contrib/hdtbl/hdtbl.tmac @@ -27,6 +27,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. .if d TBL \ . nx . +.ds hdtbl hdtbl.tmac\" +. .mso hdmisc.tmac .mso 62bit.tmac . @@ -114,8 +116,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . el \{\ . ie \B\\*[cols] \ . nr t*cols\\n[t*#] \\*[cols] -. el \ -. tm \\n[.F]:\\n[.c]: Invalid number of columns value '\\*[cols]'. +. el \{\ +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid number of columns value +. tm1 " '\\*[cols]'. +. \} . \} . . t*getarg cpd \\*[args] \" cell padding @@ -124,8 +128,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . el \{\ . ie \B\\*[cpd] \ . nr t*cpd\\n[t*#] \\*[cpd] -. el \ -. tm \\n[.F]:\\n[.c]: Invalid cell padding value '\\*[cpd]'. +. el \{\ +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid cell padding value +. tm1 " '\\*[cpd]'. +. \} . \} . . t*getarg csp \\*[args] \" cell spacing @@ -134,8 +140,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . el \{\ . ie \B\\*[csp] \ . nr t*csp\\n[t*#] \\*[csp] -. el \ -. tm \\n[.F]:\\n[.c]: Invalid cell spacing value '\\*[csp]'. +. el \{\ +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid cell spacing value +. tm1 " '\\*[csp]'. +. \} . \} . . t*getarg border \\*[args] \" border thickness @@ -147,8 +155,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . el \{\ . ie \B\\*[border] \ . nr t*b\\n[t*#] \\*[border] -. el \ -. tm \\n[.F]:\\n[.c]: Invalid border thickness value '\\*[border]'. +. el \{\ +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid border thickness +. tm1 " value '\\*[border]'. +. \} . \}\} . . t*getarg bc \\*[args] \" border color @@ -160,7 +170,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . ie "\\*[bc]"=" \ . ds t*bc\\n[t*#] =\" . el \ -. tm \\n[.F]:\\n[.c]: Invalid border color '\\*[bc]'. +. tm \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid border color '\\*[bc]'. . \}\} . ie "\\*[bc]"=" \ . ds t*bc\\n[t*#] @@ -187,7 +197,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. - ((2 * \\n[cscp\\n[t*#]]) \ + (3 * \\n[b/2\\n[t*#]]))) . el \ -. tm \\n[.F]:\\n[.c]: Invalid height value '\\*[height]'. +. tm \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid height value '\\*[height]'. . \} . . t*cl \\*[width] \" get cell widths and offsets @@ -205,8 +215,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . ie "\\*[tal]"r" \ . nr in\\n[t*#] (\\n[.l] - \\n[ll\\n[t*#]] + \\n[.i]) . el \{\ -. tmc \\n[.F]:\\n[.c]: Invalid horizontal table alignment '\\*[tal]': -. tm1 " must be 'l', 'c' or 'r'. +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid horizontal table +. tm1 " alignment '\\*[tal]': must be 'l', 'c' or 'r'. . \}\}\} . . nr t*r#\\n[t*#] 0 \" initialize row index @@ -224,7 +234,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . . if "\\$0"CPTN" \ . if \\n[t*r#\\n[t*#]] \{\ -. tmc \\n[.F]:\\n[.c]: Invalid placement of '.CPTN'; +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid placement of '.CPTN'; . tm1 " must be called immediately after '.TBL'. . return . \} @@ -270,7 +280,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. .de TR . ft 1 . if !\\n[t*#] \{\ -. tm \\n[.F]:\\n[.c]: Table row (.TR) without preceding table start (.TBL). +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Table row (.TR) without preceding +. tm1 " table start (.TBL). . return . \} . @@ -290,8 +301,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . el \{\ . ie \B\\*[height] \ . nr t*height\\*[#t#r] \\*[height] -. el \ -. tm \\n[.F]:\\n[.c]: Invalid table row height '\\*[height]'. +. el \{\ +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid table row height +. tm1 " '\\*[height]'. +. \} . \} . . \" If there is a TR with height 'height', the total height of the table @@ -311,7 +324,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. .de TH . ft 1 . if !\\n[t*#] \{\ -. tm \\n[.F]:\\n[.c]: Table heading (.TH) without preceding table start (.TBL). +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Table heading (.TH) without +. tm1 " preceding table start (.TBL). . return . \} . t*getarg hal \\$@ @@ -349,7 +363,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . nr *rsp*\\*[*#trc*] (\\n[rowspan] - 1) . \} . el \ -. tm \\n[.F]:\\n[.c]: Invalid value of 'rowspan' keyword. +. tm \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid value of 'rowspan' keyword. . \} . . t*getarg colspan \\*[args] @@ -358,7 +372,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . ie \B\\*[colspan] \ . nr colspan (\\*[colspan] >? 1) . el \ -. tm \\n[.F]:\\n[.c]: Invalid value of 'colspan' keyword. +. tm \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid value of 'colspan' keyword. . \} . . t*args \\*[#trc] \\*[#t#r] \" look for common arguments @@ -398,7 +412,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . ds * is\" . ds ** column\" . \} -. tmc \\n[.F]:\\n[.c]: There \\*[*] \\n[c#\\*[#t#r]] table \\*[**] (.TD) +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: There \\*[*] \\n[c#\\*[#t#r]] table +. tm1 " \*[**] (.TD) . . ds * are\" . if (\\n[t*cols\\n[t*#]] == 1) \ @@ -438,11 +453,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. .de ETB . ie \\n[t*#] \ . if !\\n[t*r#\\n[t*#]] \{\ -. tmc \\n[.F]:\\n[.c]: Each table (.TBL) +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Each table (.TBL) . tm1 " should contain at least one table row (.TR)! . \} . el \{\ -. tmc \\n[.F]:\\n[.c]: Table end (.ETB) +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Table end (.ETB) . tm1 " without corresponding table start (.TBL)! . \} . @@ -474,7 +489,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . \} . el \{\ . rn t*tbl0 t*hold\\n+[t*numb] -. tm \\n[.F]:\\n[.c]: Table t*hold\\n[t*numb] held. +. tm \*[hdtbl]:\\n[.F]:\\n[.c]: Table t*hold\\n[t*numb] held. . ds t*held \\*[t*held] t*hold\\n[t*numb] \\n[dn]\" . \} . @@ -501,13 +516,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. .de t*free . if "\\$0"CPTN" \ . if \\n[t*r#\\n[t*#]] \{\ -. tmc \\n[.F]:\\n[.c]: Invalid placement of '.t*free' within a table; -. tm1 " it must be called outside of any table. +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid placement of '.t*free' +. tm1 " within a table; it must be called outside of any table. . return . \} . . if "\\*[t*held]"" \{\ -. tm \\n[.F]:\\n[.c]: No held tables. +. tm \*[hdtbl]:\\n[.F]:\\n[.c]: No held tables. . return . \} . @@ -746,14 +761,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . substring ** 0 -2 . ie \B\\*[**] \ . nr $\\n[*] (\\*[**] * \\n[.l] / 100) -. el \ -. tm \\n[.F]:\\n[.c]: Invalid relative cell width '\\*[**]%'. +. el \{\ +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid relative cell width +. tm1 " '\\*[**]%'. +. \} . \} . el \{\ . ie \B\\$[\\n[*]] \ . nr $\\n[*] \\$[\\n[*]] -. el \ -. tm \\n[.F]:\\n[.c]: Invalid cell width '\\$[\\n[*]]'. +. el \{\ +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid cell width +. tm1 " '\\$[\\n[*]]'. +. \} . \}\} . . nr ll\\n[t*#] +\\n[$\\n[*]] @@ -761,7 +780,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . \} . . if (\\n[ll\\n[t*#]] > \\n[.l]) \ -. tm \\n[.F]:\\n[.c]: Table width larger than column width. +. tm \*[hdtbl]:\\n[.F]:\\n[.c]: Table width larger than column width. . . nr ** (0 >? \\n[t*b\\n[t*#]]) . nr * 0 1 @@ -796,8 +815,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . nr *** (\\n[*] % 10) . if d nth-\\n[***] \ . ds * \\n[*]\\*[nth-\\n[***]]\" -. tmc \\n[.F]:\\n[.c]: The \\*[*] width value (\\$\\n[*]) is too small. -. tm1 " It should be greater than \\n[*h]. +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: The \\*[*] width value (\\$\\n[*]) +. tm1 " is too small. It should be greater than \\n[*h]. . \} . . nr in\\n[t*#]*\\n[*] \\n[**] \" cell offset @@ -853,7 +872,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . ds * is\" . ds ** column\" . \} -. tmc \\n[.F]:\\n[.c]: There \\*[*] only \\n[c#\\*[#t#r]] \\*[**] +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: There \\*[*] only \\n[c#\\*[#t#r]] +. tm1 " \\*[**] . . nr * \\n[t*r#\\n[t*#]] . ds * \\n[*]th\" @@ -898,8 +918,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . el \{\ . ie "\\*[bgc]"=" \ . ds t*bgc\\$1 =\" -. el \ -. tm \\n[.F]:\\n[.c]: Invalid background color '\\*[bgc]'. +. el \{\ +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid background color +. tm1 " '\\*[bgc]'. +. \} . \}\} . if "\\*[args]"" \ . return @@ -911,8 +933,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . el \{\ . ie "\\*[fgc]"=" \ . ds t*fgc\\$1 =\" -. el \ -. tm \\n[.F]:\\n[.c]: Invalid foreground color '\\*[fgc]'. +. el \{\ +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid foreground color +. tm1 " '\\*[fgc]'. +. \} . \}\} . if "\\*[args]"" \ . return @@ -935,8 +959,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . ie \\n[t*index] \ . ds t*hal\\$1 \\*[hal]\" . el \{\ -. tmc \\n[.F]:\\n[.c]: Invalid horizontal alignment '\\*[hal]': -. tm1 " must be 'b', 'c', 'l' or 'r'. +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid horizontal alignment +. tm1 " '\\*[hal]': must be 'b', 'c', 'l' or 'r'. . \}\} . if "\\*[args]"" \ . return @@ -947,8 +971,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . ie \\n[t*index] \ . ds t*val\\$1 \\*[val]\" . el \{\ -. tmc \\n[.F]:\\n[.c]: Invalid vertical alignment '\\*[val]': -. tm1 " must be 't', 'm' or 'b'. +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Invalid vertical alignment +. tm1 " '\\*[val]': must be 't', 'm' or 'b'. . \}\} . if "\\*[args]"" \ . return @@ -980,14 +1004,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. . pops * t*kept . popr * t*kept . if (\\n[*] - \\n[**]) \{\ -. tm \\n[.F]:\\n[.c]: Table \\*[*] higher than page -- ignored! +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Table \\*[*] higher than page -- +. tm1 " ignored! . break . \} . . if (\\n[*] - \\n[.t]) \{\ . ds t*kept \\n[*] \\*[t*kept]\" . ds t*kept \\*[*] \\*[t*kept]\" -. tmc \\n[.F]:\\n[.c]: Remaining table(s), +. tmc \*[hdtbl]:\\n[.F]:\\n[.c]: Remaining table(s), . tm1 " because not all fit onto this page. . break . \} _______________________________________________ groff-commit mailing list groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit