[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 13/16: [man]: Fix paragraph tag regressions.
From: |
G. Branden Robinson |
Subject: |
[groff] 13/16: [man]: Fix paragraph tag regressions. |
Date: |
Sat, 6 Nov 2021 01:38:21 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 6aaef43904552889911e8a3e8d7006eb9f7adb64
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Nov 6 07:00:11 2021 +1100
[man]: Fix paragraph tag regressions.
* tmac/an-ext.mac (UR, MR): Only create an environment and diversion if
we're not already in one of the latter. If we are (in groff man, this
occurs only when collecting a `TP` paragraph tag), then typeset the
URI as part of the indented paragraph.
(UE, ME): Pop the diversion and environment stacks only if we pushed
them in the first place. Eliminate spurious space in post-URI
arguments by only typesetting excess macro parameters if there were
any.
Fixes <https://savannah.gnu.org/bugs/?61425>.
---
ChangeLog | 13 +++++++++++++
tmac/an-ext.tmac | 24 ++++++++++++++++--------
2 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5077510..2c44050 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2021-11-06 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [man]: Fix paragraph tag regressions.
+
+ * tmac/an-ext.mac (UR, MR): Only create an environment and
+ diversion if we're not already in one of the latter. If we are
+ {in groff man, this occurs only when collecting a `TP` paragraph
+ tag}, then typeset the URI as part of the indented paragraph.
+ (UE, ME): Pop the diversion and environment stacks only if we
+ pushed them in the first place. Eliminate spurious space in
+ post-URI arguments by only typesetting excess macro parameters
+ if there were any.
+
2021-11-05 G. Branden Robinson <g.branden.robinson@gmail.com>
[man]: Regression-test Savannah #61425.
diff --git a/tmac/an-ext.tmac b/tmac/an-ext.tmac
index 7a6e4b9..846bf65 100644
--- a/tmac/an-ext.tmac
+++ b/tmac/an-ext.tmac
@@ -100,7 +100,10 @@
.\" Start URL.
.de UR
. ds m1 \\$1\"
-. if \\nU&\\n(mU \{\
+. \" We can only hyperlink if we're not in a diversion.
+. nr mD 0
+. if '\\n(.z'' .nr mD 1
+. if \\n(mD&\\nU&\\n(mU \{\
. \" Start diversion in a new environment.
. do ev link-text-env
. do di link-text-div
@@ -110,7 +113,7 @@
.
.\" End URL.
.de UE
-. ie \\nU&\\n(mU \{\
+. ie \\n(mD&\\nU&\\n(mU \{\
. br
. di
. ev
@@ -142,17 +145,21 @@
. nh
\\*(la\\*(m1\\*(ra\\$1
. do shift
-. ie \n(.g \&\\$*\"
-. el \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9\"
+. ie \n(.g .if \n(.$ \&\\$*\"
+. el .if \n(.$>1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9\"
. hy \\n(HY
. \}
+. rr mD
..
.
.
.\" Start email address.
.de MT
. ds m1 \\$1\"
-. if \\nU&\\n(mU \{\
+. \" We can only hyperlink if we're not in a diversion.
+. nr mD 0
+. if '\\n(.z'' .nr mD 1
+. if \\n(mD&\\nU&\\n(mU \{\
. \" Start diversion in a new environment.
. do ev link-text-env
. do di link-text-div
@@ -162,7 +169,7 @@
.
.\" End email address.
.de ME
-. ie \\nU&\\n(mU \{\
+. ie \\n(mD&\\nU&\\n(mU \{\
. br
. di
. ev
@@ -194,10 +201,11 @@
. nh
\\*(la\\*(m1\\*(ra\\$1
. do shift
-. ie \n(.g \&\\$*\"
-. el \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9\"
+. ie \n(.g .if \n(.$ \&\\$*\"
+. el .if \n(.$>1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9\"
. hy \\n(HY
. \}
+. rr mD
..
.
.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 13/16: [man]: Fix paragraph tag regressions.,
G. Branden Robinson <=