[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 08/13: [man]: Fix extra space when `ME`, `UE` + -mandoc.
From: |
G. Branden Robinson |
Subject: |
[groff] 08/13: [man]: Fix extra space when `ME`, `UE` + -mandoc. |
Date: |
Sat, 16 Apr 2022 04:37:32 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 0e84b1acbe52ebf055130a5af47bdf8092f8e530
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Apr 14 12:49:55 2022 +1000
[man]: Fix extra space when `ME`, `UE` + -mandoc.
[man]: Fix extraneous space when `ME` or `UE` given extraneous arguments
and mandoc wrapper is used.
* tmac/an-ext.tmac (UE, ME): Double backslashes in macro definitions
when interpolating `.$` register (just like we tell everyone else to
do). This one was interesting to track down. When using just `-man`,
the problem never manifested; only with `-mandoc`. The difference is
that with the former, the `.$` register is initialized to zero; with
the latter, because `TH` is aliased to another macro (then unaliased),
`.$` has the argument count to the `TH` macro, not to the macros
actually being called. This caused the wrong branch of a conditional
to be taken and put an extra space node on the output. And all this
to interpolate arguments we don't even claim to support. :|
Fixes <https://savannah.gnu.org/bugs/?62044>.
Also fix nearby indentation error.
---
ChangeLog | 19 +++++++++++++++++++
tmac/an-ext.tmac | 12 ++++++------
2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 04120476..55aacc86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2022-04-14 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [man]: Fix extraneous space when `ME` or `UE` given extraneous
+ arguments and mandoc wrapper is used.
+
+ * tmac/an-ext.tmac (UE, ME): Double backslashes in macro
+ definitions when interpolating `.$` register (just like we tell
+ everyone else to do). This one was interesting to track down.
+ When using just `-man`, the problem never manifested; only with
+ `-mandoc`. The difference is that with the former, the `.$`
+ register is initialized to zero; with the latter, because `TH`
+ is aliased to another macro (then unaliased), `.$` has the
+ argument count to the `TH` macro, not to the macros actually
+ being called. This caused the wrong branch of a conditional to
+ be taken and put an extra space node on the output. And all
+ this to interpolate arguments we don't even claim to support. :|
+
+ Fixes <https://savannah.gnu.org/bugs/?62044>.
+
2022-04-14 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/cp1047.tmac:
diff --git a/tmac/an-ext.tmac b/tmac/an-ext.tmac
index 0ddf29d3..0c31551d 100644
--- a/tmac/an-ext.tmac
+++ b/tmac/an-ext.tmac
@@ -147,11 +147,11 @@
. nh
\\*(mL\\*(m1\\*(mR\\$1
. do shift
-. ie \n(.g .if \n(.$ \&\\$*\"
-. el .if \n(.$>1 \\$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(mJ
. \}
-. rr mD
+. rr mD
..
.
.
@@ -203,11 +203,11 @@
. nh
\\*(mL\\*(m1\\*(mR\\$1
. do shift
-. ie \n(.g .if \n(.$ \&\\$*\"
-. el .if \n(.$>1 \\$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(mJ
. \}
-. rr mD
+. rr mD
..
.
.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 08/13: [man]: Fix extra space when `ME`, `UE` + -mandoc.,
G. Branden Robinson <=