groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 26/30: [mm]: Fix Savannah #63739.


From: G. Branden Robinson
Subject: [groff] 26/30: [mm]: Fix Savannah #63739.
Date: Sat, 12 Oct 2024 12:07:56 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit bcda17efad5d996b089553d226599619acb5c4b7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Oct 12 04:31:50 2024 -0500

    [mm]: Fix Savannah #63739.
    
    Handle `nP` paragraphs more compatibly with DWB 3.3 mm.
    
    * contrib/mm/m.tmac (nP): Apply a temporary indentation to the second
      output line of a paragraph to align it with the start of the paragraph
      text (not the tag/label) in the first.
    
      (H): Reset the `nP` paragraph counter when the first- or second-level
      section heading number increments.
    
    * contrib/mm/groff_mm.7.man (Description): Drop notice of difference
      between DWB 3.3 and groff mm `nP` behavior.
    
      (Macros <H>, Registers <Hb>): Document interaction of `nP` and `Np`
      features with run-in headings.
    
    Fixes <https://savannah.gnu.org/bugs/?63739>.
    
    NEWS: Add item.
---
 NEWS                      |  6 ++++++
 contrib/mm/ChangeLog      | 17 +++++++++++++++++
 contrib/mm/groff_mm.7.man | 26 +++++++++++---------------
 contrib/mm/m.tmac         |  5 ++++-
 4 files changed, 38 insertions(+), 16 deletions(-)

diff --git a/NEWS b/NEWS
index 18aee6696..29f33d99f 100644
--- a/NEWS
+++ b/NEWS
@@ -466,6 +466,12 @@ Macro packages
 
 *  The m (mm) macro package now supports AT&T/DWB mm's `Rg` string.
 
+*  The m (mm) macro package's `nP` macro now behaves more like DWB mm's.
+   It applies a temporary indentation to the second output line of a
+   paragraph to align it with the start of the paragraph text (not the
+   tag/label) in the first, and resets the paragraph counter when the
+   first- or second-level section heading number increments.
+
 *  The s (ms) macro package now sets the vertical spacing register
    defaults for normal (`VS`) and footnote (`FVS`) text to 120% of the
    type size configured in the `PS` and `FPS` registers, respectively,
diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 972f0e352..2720612d0 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,20 @@
+2024-10-12  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       Handle `nP` paragraphs more compatibly with DWB 3.3 mm.
+
+       * m.tmac (nP): Apply a temporary indentation to the second
+       output line of a paragraph to align it with the start of the
+       paragraph text (not the tag/label) in the first.
+       (H): Reset the `nP` paragraph counter when the first- or
+       second-level section heading number increments.
+
+       * groff_mm.7.man (Description): Drop notice of difference
+       between DWB 3.3 and groff mm `nP` behavior.
+       (Macros <H>, Registers <Hb>): Document interaction of `nP` and
+       `Np` features with run-in headings.
+
+       Fixes <https://savannah.gnu.org/bugs/?63739>.
+
 2024-10-12  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        Regression-test Savannah #63739 (unit-test `nP` macro).
diff --git a/contrib/mm/groff_mm.7.man b/contrib/mm/groff_mm.7.man
index c18e71dab..b0b5a3c71 100644
--- a/contrib/mm/groff_mm.7.man
+++ b/contrib/mm/groff_mm.7.man
@@ -226,17 +226,6 @@ DWB used a hard-coded value of 6\~ens.
 .
 .
 .IP \[bu]
-DWB
-.IR mm 's
-.B nP
-macro indented the second line of a paragraph to align it with the start
-of the text of the first
-(after the paragraph number);
-.IR "groff mm" 's
-does not.
-.
-.
-.IP \[bu]
 .I "groff mm"
 uses the same adjustment and font defaults in
 .I nroff
@@ -1962,9 +1951,10 @@ and register
 sets a threshold within which vertical space follows it.
 .
 If the heading level is above both of these,
-a
-.I run-in heading
-is produced;
+and the paragraph is not numbered,
+.I "groff mm"
+produces a
+.IR "run-in heading" ;
 paragraph text follows on the same output line.
 .
 Otherwise,
@@ -4947,7 +4937,13 @@ and
 sets the threshold for breaking the line after formatting a heading.
 .
 Text after headings at levels above this value is set on the same
-output line if possible;
+output line if possible.
+.
+Paragraphs numbered via
+.B nP
+or the
+.B Np
+register cause a break regardless;
 see
 .B H
 .RB ( 2 ).
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 07ad99fcd..817958fc1 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -510,10 +510,12 @@ http://savannah.gnu.org/bugs/?group=groff.
 .      tm Paragraph nl=\\n[nl], last=\\n[hd*last-pos]
 .      tm Paragraph .k=\\n[.k], hsize=\\n[hd*last-hsize]
 .\}
-.\" A first-line indentation is meaningless for a numbered paragraph.
+.\" `nP` handles indentation differently from `P`.
 .nr par*indentation-eligible 0
 .par@doit
 \\n[H2].\\n+[par*nP-counter]\ \ \c
+.\" Indent the paragraph's second line, too.
+'ti \w'\\n[H2].\\n[par*nP-counter]'u+2n
 ..
 .\"------------
 .de par@doit
@@ -1156,6 +1158,7 @@ numeric; got '\\$1'
 .el                         .SP (u;\\n[Hps1])
 .\"
 .if \\$1=1&\\n[Np] .nr par*Np-counter 0
+.if \\$1<3         .nr par*nP-counter 0
 .\" start diversion to measure size of header
 .di hd*div
 \\*[hd*mark]\\$2\\$3\\*[hd*suf-space]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]