gbranden pushed a commit to branch master
in repository groff.
commit c69ac0ec5f63091f8464196d34f53df92c37daab
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Oct 9 15:09:41 2025 -0500
[ms]: Issue helpful diagnostic.
...if it looks like the user failed to preprocess a document calling
`TE`.
* tmac/s.tmac: Add new register `tbl*was-tbl-failure-reported` and new
macro `tbl*check-for-tbl`, which sets the register.
(TE): Call the new macro. If the failure has been reported, tbl has
not run, so we can skip the rest of this macro.
---
ChangeLog | 9 +++++++++
tmac/s.tmac | 13 +++++++++++++
2 files changed, 22 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 7defdf414..12dad7545 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-10-09 G. Branden Robinson <[email protected]>
+
+ * tmac/s.tmac: Issue helpful diagnostic if it looks like the
+ user failed to preprocess a document calling `TE`. Add new
+ register `tbl*was-tbl-failure-reported` and new macro
+ `tbl*check-for-tbl`, which sets the register.
+ (TE): Call the new macro. If the failure has been reported,
+ tbl has not run, so we can skip the rest of this macro.
+
2025-10-09 G. Branden Robinson <[email protected]>
[tbl]: Fix Savannah #64529.
diff --git a/tmac/s.tmac b/tmac/s.tmac
index f91822958..0867773fd 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -2007,6 +2007,17 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.\" Tbl support.
.nr tbl@within-table 0
.nr tbl*has-heading 0
+.nr tbl*was-tbl-failure-reported 0
+.de tbl*check-for-tbl
+.if !r TW .if !\\n[tbl*was-tbl-failure-reported] \{\
+. ds tbl*err tbl preprocessor failed, or it or soelim was not
+. as tbl*err " run; table(s) likely not rendered\"
+. as tbl*err " (TE macro called with TW register undefined)\"
+. @error \\*[tbl*err]
+. rm tbl*err
+. nr tbl*was-tbl-failure-reported 1
+.\}
+..
.\" This gets called if TS occurs before the first paragraph.
.de TS
.cov*ab-init
@@ -2072,6 +2083,8 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.TE
..
.de TE
+.tbl*check-for-tbl
+.if \\n[tbl*was-tbl-failure-reported] .return
.ie '\\n(.z'tbl*heading-diversion' \
. @error-recover .TS H but no .TH before .TE
.el \{\
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit