gbranden pushed a commit to branch master
in repository groff.
commit b3b1c2a7440cff29ce762d0c637b16872153f838
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Jun 21 09:44:25 2024 -0500
[mm]: Validate state when `MULN`, `NCOL` called.
* contrib/mm/m.tmac (NCOL): Validate package state, throwing warning if
called when not in multi-column mode.
(MULN): Validate package state, aborting with error if not in
multi-column mode, rather than accessing undefined registers and
spewing much noise about internal parameters if `-wreg` enabled.
---
contrib/mm/ChangeLog | 8 ++++++++
contrib/mm/m.tmac | 5 ++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 03423efeb..66a9a08c3 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,11 @@
+2024-06-21 G. Branden Robinson <[email protected]>
+
+ * m.tmac (NCOL): Validate package state, throwing warning if
+ called when not in multi-column mode.
+ (MULN): Validate package state, aborting with error if not in
+ multi-column mode, rather than accessing undefined registers and
+ spewing much noise about internal parameters if `-wreg` enabled.
+
2024-06-15 G. Branden Robinson <[email protected]>
* examples/story.mm: New file illustrates a "normal" document,
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index f1965d09c..f37592308 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -1672,8 +1672,10 @@ page
.ll \\n[pg*column-size]u
.\" .lt \\n[pg*column-size]u
..
-.\" begin a new column
+.\" begin a new column if using `2C` or `MC`
.de NCOL
+.if \\n[pg*cols-per-page]<2 .@warning \\$0: not in multi-column mode; \
+breaking page
.br
.if \\n[nl]>\\n[pg*last-ncol] .nr pg*last-ncol \\n[nl]
.pg@footer
@@ -1717,6 +1719,7 @@ page
..
.\"-----------
.de MULN
+.if \\n[pg*cols-per-page]<2 .@error \\$0: not in multi-column mode
.if \\n[pg*mul-x]>=\\n[pg*mul-max-col] .@abort undefined column width \
(pg*mul-x=\\n[pg*mul-x >= pg*mul-max-col=\\n[pg*mul-max])
.br
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit