[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 19/51: [mdoc]: Handle setup macro use degeneracy better.
From: |
G. Branden Robinson |
Subject: |
[groff] 19/51: [mdoc]: Handle setup macro use degeneracy better. |
Date: |
Sun, 11 Sep 2022 08:15:51 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 4080ed7f3b4a3c7e361dec2cb4276a2d6398bd89
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Sep 6 18:38:33 2022 -0500
[mdoc]: Handle setup macro use degeneracy better.
* tmac/mdoc/doc-common: Populate default date string `doc-date-string`
with "UNDATED".
(Dd, Dt, Os): Make more orthogonal: stop touching `doc-topic-name`.
It is "doc.tmac"'s job to initialize it and the `Nm` macro's job to
update it.
(Dd): Do nothing if given no arguments. (You can still blank
out the document date with an explicitly empty argument:
.Dd ""
.)
Fixes <https://savannah.gnu.org/bugs/?62774> (1/7).
Fix code style nit: end string defs with comment escape sequences.
---
ChangeLog | 14 ++++++++++++++
tmac/mdoc/doc-common | 14 +++++---------
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3fa42425e..7ea35ed78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2022-09-06 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * tmac/mdoc/doc-common: Populate default date string
+ `doc-date-string` with "UNDATED".
+ (Dd, Dt, Os): Make more orthogonal: stop touching
+ `doc-topic-name`. It is "doc.tmac"'s job to initialize it and
+ the `Nm` macro's job to update it.
+ (Dd): Do nothing if given no arguments. (You can still blank
+ out the document date with an explicitly empty argument:
+ .Dd ""
+ .)
+
+ Fixes <https://savannah.gnu.org/bugs/?62774> (1/7).
+
2022-09-06 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/mdoc/doc-common: Change `doc-default-operating-system`
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index acd3b227c..0d1327cf6 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -219,7 +219,6 @@
.\" NS doc-document-title
.\" NS doc-section
.\" NS doc-volume
-.\" NS doc-topic-name
.\" NS
.\" NS local variables:
.\" NS doc-volume-as-XXX
@@ -342,7 +341,6 @@
.eo
.de Dt
. \" reset default arguments
-. ds doc-topic-name \" empty
. ds doc-volume LOCAL
. ds doc-section \" empty
.
@@ -821,8 +819,6 @@
.
.eo
.de Os
-. ds doc-topic-name \" empty
-.
. ie "\$1"" \
. ds doc-operating-system "\*[doc-default-operating-system]
. el \{ .ie "\$1"ATT" \{\
@@ -897,7 +893,7 @@
.\" NS doc-date-string global string
.\" NS the manual page date as set by 'Dd'
.
-.ds doc-date-string \" empty
+.ds doc-date-string UNDATED\"
.
.
.\" NS Dd user macro (not parsed, not callable)
@@ -905,15 +901,15 @@
.\" NS
.\" NS modifies:
.\" NS doc-date-string
-.\" NS doc-topic-name
.\" NS
.\" NS width register 'Dd' set above
.
.eo
.de Dd
-. ds doc-topic-name \" empty
-. ie "\$1"$Mdocdate:" .ds doc-date-string \$2\~\$3, \$4
-. el .ds doc-date-string \$*
+. if \n[.$] \{\
+. ie "\$1"$Mdocdate:" .ds doc-date-string \$2\~\$3, \$4\"
+. el .ds doc-date-string \$*\"
+. \}
..
.ec
.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 19/51: [mdoc]: Handle setup macro use degeneracy better.,
G. Branden Robinson <=