gbranden pushed a commit to branch master
in repository groff.
commit 91d1329e361fbabbe2a3038052a2e4eadd098f10
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Feb 1 19:05:08 2024 -0600
tmac/an.tmac: Refactor.
* tmac/an.tmac: Refactor.
(TH, an-write-paragraph-tag, an-input-trap, TP): Replace register
`an*is-in-paragraph-tag-diversion` with `an*have-paragraph-tag`
changing its meaning to indicate whether we have collected a paragraph
tag in a diversion that we need to output.
(TP): Detect nesting of `TP` or `TQ` by testing name of current
diversion instead of `an*is-in-paragraph-tag-diversion` register.
---
ChangeLog | 12 ++++++++++++
tmac/an.tmac | 10 +++++-----
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 49063f8b5..5095d2a50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2024-02-01 G. Branden Robinson <[email protected]>
+
+ * tmac/an.tmac: Refactor.
+ (TH, an-write-paragraph-tag, an-input-trap, TP): Replace
+ register `an*is-in-paragraph-tag-diversion` with
+ `an*have-paragraph-tag` changing its meaning to indicate whether
+ we have collected a paragraph tag in a diversion that we need to
+ output.
+ (TP): Detect nesting of `TP` or `TQ` by testing name of current
+ diversion instead of `an*is-in-paragraph-tag-diversion`
+ register.
+
2024-02-01 G. Branden Robinson <[email protected]>
* tmac/an.tmac (TP): Don't set up an input trap if we're bailing
diff --git a/tmac/an.tmac b/tmac/an.tmac
index 2540ff5e1..1852f1219 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -299,7 +299,7 @@
.
. nr an-need-no-space-mode 0
. nr an-need-break 0
-. nr an*is-in-paragraph-tag-diversion 0
+. nr an*have-paragraph-tag 0
. nr an*is-in-example 0
. nr an*is-in-link-text-diversion 0
.
@@ -640,7 +640,6 @@ contains unsupported escape sequence
. br
. di
. ad \\*[AD]
-. nr an*is-in-paragraph-tag-diversion 0
. ll
. \" We must emit the diversion in a separate environment to ensure
. \" that a possible margin character is printed correctly.
@@ -658,6 +657,7 @@ contains unsupported escape sequence
. if \\n[an-tag-fits] .DEVTAG-COL 1
. an*paragraph-tag
. rm an*paragraph-tag
+. nr an*have-paragraph-tag 0
. if \\n[an-tag-fits] .sp -1v
. ev
. in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
@@ -684,7 +684,7 @@ contains unsupported escape sequence
. ns
. nr an-need-no-space-mode 0
. \}
-. if \\n[an*is-in-paragraph-tag-diversion] .an-write-paragraph-tag
+. if \\n[an*have-paragraph-tag] .an-write-paragraph-tag
..
.
.\" Break a paragraph. Restore defaults, except for indentation.
@@ -814,14 +814,14 @@ contains unsupported escape sequence
.de1 TP
. an-break-paragraph
. if \\n[.$] .nr an-prevailing-indent (n;\\$1)
-. if \\n[an*is-in-paragraph-tag-diversion] \{\
+. if '\\n[.z]'an*paragraph-tag' \{\
. an-warn cannot nest .\\$0 or .TQ inside .\\$0; supply a tag
. return
. \}
+. nr an*have-paragraph-tag 1
. itc 1 an-input-trap
. in 0
. ll -\\n[an-margin]u
-. nr an*is-in-paragraph-tag-diversion 1
. di an*paragraph-tag
. na
..
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit