gbranden pushed a commit to branch master
in repository groff.
commit 05ecf380dbba172b75a84ac6c9cde1315a99c214
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Oct 29 18:25:58 2025 -0500
[mdoc]: Slightly refactor.
* tmac/doc.tmac (doc-get-arg-type*): Drop unnecessary `el` branch (the
argument type is already presumptively made '2' at the top of the
macro definition); thanks to Ingo Schwarze for the suggestion.
Convert its counterpart `ie` request to `if` accordingly. Migrate
comment outside of macro definition, which seems more idiomatic when
the escape character is disabled. Consequently no empty requests
remain and we can drop the brace escape sequences around the single
chain of `if` requests remaining.
---
ChangeLog | 12 ++++++++++++
tmac/doc.tmac | 14 ++++++--------
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3e256da8c..f8894b875 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2025-10-29 G. Branden Robinson <[email protected]>
+
+ * tmac/doc.tmac (doc-get-arg-type*): Slightly refactor. Drop
+ unnecessary `el` branch (the argument type is already
+ presumptively made '2' at the top of the macro definition);
+ thanks to Ingo Schwarze for the suggestion. Convert its
+ counterpart `ie` request to `if` accordingly. Migrate comment
+ outside of macro definition, which seems more idiomatic when the
+ escape character is disabled. Consequently no empty requests
+ remain and we can drop the brace escape sequences around the
+ single chain of `if` requests remaining.
+
2025-10-16 Dave Kemper <[email protected]>
* tmac/fallbacks.tmac: Update annotations. Clean up a handful
diff --git a/tmac/doc.tmac b/tmac/doc.tmac
index 6ac084686..87d8012e0 100644
--- a/tmac/doc.tmac
+++ b/tmac/doc.tmac
@@ -2627,6 +2627,10 @@
.\" NS this macro sets the 'doc-width' register using the 'length'
.\" NS request to get the number of characters in a string literally
.\" NS
+.\" NS Ignore the *roff internal string '.T'; the formatter also
+.\" NS defines a '.T' _register_, colliding perfectly with mdoc's
+.\" NS argument type system.
+.\" NS
.\" NS modifies:
.\" NS doc-arg-type
.\" NS doc-width
@@ -2640,17 +2644,11 @@
. ie (\n[doc-width] == 1) \
. if r doc-punct\*[doc-arg\$1] \
. nr doc-arg-type \n[doc-punct\*[doc-arg\$1]]
-. el \{\
-. \" Handle the *roff internal string '.T' specially; it is defined
-. \" in the formatter, which _also_ defines a '.T' _register_,
-. \" colliding perfectly with mdoc's argument type system.
-. ie !'\?\*[doc-arg\$1]\?'\?.T\?' \
+. el \
+. if !'\?\*[doc-arg\$1]\?'\?.T\?' \
. if r \*[doc-arg\$1] \
. if d \*[doc-arg\$1] \
. nr doc-arg-type 1
-. el \
-. nr doc-arg-type 2
-. \}
. \}
..
.ec
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit