gbranden pushed a commit to branch master
in repository groff.

commit 9cfe8d43a14e8eda6b0962409a2cc49f251b8911
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Sep 8 08:41:45 2026 -0500

    [mm]: Fix Savannah #68667.
    
    * contrib/mm/m.tmac (VL, BVL): Alter internal logic to avoid
      interpolating first macro argument too soon.  Because `LB` expects
      this numeric expression to be implicitly in ens, not basic units, we
      can't store it to a register first lest we lose any associated scaling
      unit, throwing off `LB`'s computation of text indentation.
    
    Fixes <https://savannah.gnu.org/bugs/?68667>.  Thanks to Deri James for
    the report of erroneous `BVL` behavior and for tracking down a relevant
    commit.  Investigation reveals that `VL` had the same defect.  Problems
    introduced by me in commits 084c44dd7b and 0afa651fdd, both 2024-07-02.
---
 contrib/mm/ChangeLog | 15 +++++++++++++++
 contrib/mm/m.tmac    | 16 ++++++----------
 2 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 96b0a592f..9502e4160 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,18 @@
+2026-09-08  G. Branden Robinson <[email protected]>
+
+       * m.tmac (VL, BVL): Alter internal logic to avoid interpolating
+       first macro argument too soon.  Because `LB` expects this
+       numeric expression to be implicitly in ens, not basic units, we
+       can't store it to a register first lest we lose any associated
+       scaling unit, throwing off `LB`'s computation of text
+       indentation.
+
+       Fixes <https://savannah.gnu.org/bugs/?68667>.  Thanks to Deri
+       James for the report of erroneous `BVL` behavior and for
+       tracking down a relevant commit.  Investigation reveals that
+       `VL` had the same defect.  Problems introduced by me in commits
+       084c44dd7b and 0afa651fdd, both 2024-07-02.
+
 2026-09-08  G. Branden Robinson <[email protected]>
 
        Regression-test Savannah #68667.
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 61fdff7b4..eeed786d0 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -2754,22 +2754,18 @@ exceeds depth of nested lists (\\n[li*lvl])
 .de VL
 \\*[debug@dump-args]\\
 .if \\n[.$]>3 .@warning \\$0: ignoring excess arguments
-.ie \\n[.$]<1 .nr li*text-indent \\n[Pi]
-.el           .nr li*text-indent \\$1
-.ie \\n[.$]<3 .LB 0\\n[li*text-indent] 0\\$2 0 0
-.el           .LB 0\\n[li*text-indent] 0\\$2 0 0 \& 0 1
-.rr li*text-indent
+.ie \\n[.$]=1     .LB \\n[Pi] 0\\$2 0 0
+.el .if \\n[.$]<3 .LB 0\\$1   0\\$2 0 0
+.el               .LB 0\\$1   0\\$2 0 0 \& 0 1
 ..
 .\" `BVL` always breaks after the tag, so the mark cannot overset.
 .\" TODO: Refactor like `ML` to call `LB` in only one place.
 .de BVL
 \\*[debug@dump-args]\\
 .if \\n[.$]>3 .@warning \\$0: ignoring excess arguments
-.ie \\n[.$]<1 .nr li*text-indent \\n[Pi]
-.el           .nr li*text-indent \\$1
-.ie \\n[.$]<3 .LB 0\\n[li*text-indent] 0\\$2 0 -1
-.el           .LB 0\\n[li*text-indent] 0\\$2 0 -1 \& 0 1
-.rr li*text-indent
+.ie \\n[.$]=1     .LB \\n[Pi] 0\\$2 0 -1
+.el .if \\n[.$]<3 .LB 0\\$1   0\\$2 0 -1
+.el               .LB 0\\$1   0\\$2 0 -1 \& 0 1
 ..
 .\" List types `BL` and `DL` use bullets and em dashes, respectively, as
 .\" the item marks, and use register `Pi` to determine text indentation.

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to