gbranden pushed a commit to branch master
in repository groff.
commit 774bac73c8ed50d858e013315fad722da7f3151b
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Jun 13 11:34:48 2024 -0500
[mm]: Support suppression of `SG`, `NS` features.
In DWB 3.3 mm, signatures (`SG`) and notations (`NS`/`NE`) are
suppressed from output in memorandum type 4 (".MT 4").
* contrib/mm/m.tmac: Add new registers `let*sg-suppress-all`,
`let*sg-suppress-annotation`, and `let*ns-suppress`. Initialize them
false.
(SG): Return immediately if `let*sg-suppress-all` is true. Otherwise,
check value of `let*sg-suppress-annotation` before emitting the
secretarial annotation. (I don't have a better term for this.)
(NS): If given arguments, return immediately if `let*ns-suppress`.
Otherwise, begin box diversion `let*ns-discard`.
(NE): If `let*ns-suppress`, end box diversion and return.
---
contrib/mm/ChangeLog | 18 ++++++++++++++++++
contrib/mm/m.tmac | 22 ++++++++++++++++++----
2 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 8e56ea1de..e43cb4377 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,21 @@
+2024-06-13 G. Branden Robinson <[email protected]>
+
+ Support suppression of `SG`, `NS` features. In DWB 3.3 mm,
+ signatures (`SG`) and notations (`NS`/`NE`) are suppressed from
+ output in memorandum type 4 (".MT 4").
+
+ * m.tmac: Add new registers `let*sg-suppress-all`,
+ `let*sg-suppress-annotation`, and `let*ns-suppress`. Initialize
+ them false.
+ (SG): Return immediately if `let*sg-suppress-all` is true.
+ Otherwise, check value of `let*sg-suppress-annotation` before
+ emitting the secretarial annotation. (I don't have a better
+ term for this.)
+ (NS): If given arguments, return immediately if
+ `let*ns-suppress`. Otherwise, begin box diversion
+ `let*ns-discard`.
+ (NE): If `let*ns-suppress`, end box diversion and return.
+
2024-06-13 G. Branden Robinson <[email protected]>
* m.tmac: Trivially refactor.
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 11c9321e4..2a4d51eca 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -3473,9 +3473,12 @@ exceeds depth of nested lists (\\n[li*lvl])
..
.\"------------------------
.\" Signature line
+.nr let*sg-suppress-all 0
+.nr let*sg-suppress-annotation 0
.de SG
+.if \\n[let*sg-suppress-all] .return
.ie d let*type .let*lt-sign \\$@
-.el .let*mt-sign \\$@
+.el .let*mt-sign \\$@
..
.\"------------------------
.de let*lt-sign
@@ -3519,8 +3522,10 @@ undefined
. ne 3v+\\n[cov*at!\\n[let*i]]v
. SP 3v
. if \\n[let*i]=\\n[let*k] \{\
-. \" Set annotation at left margin of last author's name.
-. nop \Z'\h'-(u;\\n[.l]/2)'\\*[let*anno]'\c
+. if !\\n[let*sg-suppress-annotation] \{\
+. \" Set annotation to left of last author's name.
+. nop \Z'\h'-(u;\\n[.l]/2)'\\*[let*anno]'\c
+. \}
. \}
. nop \\*[cov*au!\\n[let*i]!1]
. \" Set author's title(s).
@@ -3757,8 +3762,13 @@ undefined
.if d let@wa-junk .rm let@wa-junk
..
.\"-------------------
-.\" Copy to
+.\" Notations ("Copy to", etc.)
+.nr let*ns-suppress 0
.de NS
+.if \\n[let*ns-suppress] \{\
+. ie \\n[.$] .return
+. el .box let*ns-discard
+.\}
.sp
.ie !''\\$2' .ds let*str \\$1
.el \{\
@@ -3776,6 +3786,10 @@ undefined
\\*[let*str]
..
.de NE
+.if \\n[let*ns-suppress] \{\
+. box
+. return
+.\}
.fi
..
.\"-------------------
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit