gbranden pushed a commit to branch master
in repository groff.

commit e0332c122ed124c53ded3e8f9fbf9881fc12fc88
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Jun 14 13:07:53 2024 -0500

    [mm]: Fix Savannah #65843 (pad/overlong mark).
    
    * contrib/mm/m.tmac (LI): Introduce list-item-local register `li*c-pad`,
      for use in overriding a single item's padding amount.  Initialize it
      to the list's padding amount (`li*pad`).  Calculate whether the mark
      is overlong using the padding amount rather than an unadjustable space
      escape sequence embedded in a `\w` width computation.  If the mark is
      overlong, override that, setting it to 2n.  Use `li*c-pad` instead of
      `li*pad` for further computations.  Remove the new register at the end
      of the macro definition.
---
 contrib/mm/ChangeLog | 12 ++++++++++++
 contrib/mm/m.tmac    | 14 +++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 2540a3a54..278ab2103 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,15 @@
+2024-06-14  G. Branden Robinson <[email protected]>
+
+       * m.tmac (LI): Fix Savannah #65843.  Introduce list-item-local
+       register `li*c-pad`, for use in overriding a single item's
+       padding amount.  Initialize it to the list's padding amount
+       {`li*pad`}.  Calculate whether the mark is overlong using the
+       padding amount rather than an unadjustable space escape sequence
+       embedded in a `\w` width computation.  If the mark is overlong,
+       override that, setting it to 2n.  Use `li*c-pad` instead of
+       `li*pad` for further computations.  Remove the new register at
+       the end of the macro definition.
+
 2024-06-14  G. Branden Robinson <[email protected]>
 
        Regression-test Savannah #65843.
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 41dce1570..9f2852d6f 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -2324,15 +2324,18 @@ ML, RL, VL, or LB first
 .      ie (\\$2=2):(\\n[Limsp]=0) .ds li*c-mark \\$1\\*[li*c-mark]
 .      el .ds li*c-mark \\$1\ \\*[li*c-mark]
 .\}
+.nr li*c-pad \\n[li*pad]
 .\"
 .\" determine where the text begins
-.if \w'\\*[li*c-mark]'>\\n[li*tind] .@warning \\$0: overlong mark \
-'\\*[li*c-mark]'
-.nr li*text-begin \\n[li*tind]>?\w@\\*[li*c-mark]\ @
+.if \w'\\*[li*c-mark]'>\\n[li*tind] \{\
+.      @warning \\$0: overlong mark '\\*[li*c-mark]'
+.      nr li*c-pad 2n \" force item/mark separation
+.\}
+.nr li*text-begin \\n[li*tind]>?\w@\\*[li*c-mark]@+\\n[li*c-pad]
 .\"
 .\" determine where the mark begin
-.ie !\\n[li*pad] .nr li*in \\n[li*mind]
-.el .nr li*in \\n[li*text-begin]-\\n[li*pad]-\w@\\*[li*c-mark]@
+.ie !\\n[li*c-pad] .nr li*mark-begin \\n[li*mind]
+.el .nr li*in \\n[li*text-begin]-\\n[li*c-pad]-\w@\\*[li*c-mark]@
 .if !\\n[li*in] .nr li*in 0
 .\"
 .ti -\\n[li*tind]u
@@ -2340,6 +2343,7 @@ ML, RL, VL, or LB first
 .if (\w@\\*[li*c-mark]@=0)&((\\n[.$]=0):(\w@\\$1@=0)) .nr li*text-begin 0
 \Z'\&\h'\\n[li*in]u'\\*[li*c-mark]'\h'\\n[li*text-begin]u'\&\c
 .if \\n[li*type]=-1 .br
+.rr li*c-pad
 ..
 .\"
 .\"-------------

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

Reply via email to