gbranden pushed a commit to branch master
in repository groff.

commit ea04e4efbb81a486f197d1570673a81b69769077
Author: G. Branden Robinson <g.branden.robin...@gmail.com>
AuthorDate: Thu Aug 7 03:53:45 2025 -0500

    [ms]: Fix Savannah #67401 (footer baseline loc).
    
    * tmac/s.tmac ([initialization], pg@top): Alter placement of page
      footer, shifting it upward by one vee, so that the size of the "footer
      margin" (register `FM`) measures as documented, and consistently with
      the "header margin" (register `HM`).  While a bug fix, and consistent
      with DWB 3.3 ms, it is inconsistent with Seventh Edition Unix ms and
      Heirloom Doctools ms.
    
    * tmac/tests/s_vertical-margins-are-correct.sh: Update test
      expectations.
    
    Fixes <https://savannah.gnu.org/bugs/?67401>.
    
    NEWS: Add item.
---
 ChangeLog                                    | 14 ++++++++++++++
 NEWS                                         | 11 +++++++++++
 tmac/s.tmac                                  |  6 ++++--
 tmac/tests/s_vertical-margins-are-correct.sh |  6 +++---
 4 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 976da8e0b..b23a8e3b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2025-08-07  G. Branden Robinson <g.branden.robin...@gmail.com>
+
+       * tmac/s.tmac ([initialization], pg@top): Alter placement of
+       page footer, shifting it upward by one vee, so that the size of
+       the "footer margin" (register `FM`) measures as documented, and
+       consistently with the "header margin" (register `HM`).  While a
+       bug fix, and consistent with DWB 3.3 ms, it is inconsistent with
+       Seventh Edition Unix ms and Heirloom Doctools ms.
+
+       * tmac/tests/s_vertical-margins-are-correct.sh: Update test
+       expectations.
+
+       Fixes <https://savannah.gnu.org/bugs/?67401>.
+
 2025-08-06  G. Branden Robinson <g.branden.robin...@gmail.com>
 
        * tmac/tests/s_vertical-margins-are-correct.sh: Add unit test of
diff --git a/NEWS b/NEWS
index a3fa58d12..c1cd66484 100644
--- a/NEWS
+++ b/NEWS
@@ -668,6 +668,17 @@ Macro packages
    size of 20 points, the vertical spacing now defaults to 24 points
    rather than 22.
 
+*  The s (ms) macro package now subtracts one vee from the footer trap
+   location computed using the `FM` register.  When using the default
+   `FM` value of `1i`, this makes the size of the margin from the footer
+   baseline to the bottom of the page 3 vees or one half-inch,
+   consistently with that between the header baseline and the page top.
+   While a bug fix, and consistent with DWB 3.3 ms, this computation is
+   inconsistent with Seventh Edition Unix ms and Heirloom Doctools ms.
+   When formatting for terminals, footers now set one line higher than
+   before.  The size of the footnote area is not affected; instead there
+   is a 1v smaller margin between its bottom and the footer baseline.
+
 Output drivers
 --------------
 
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 959ee9109..a282fdabd 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -566,8 +566,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .de P1
 .nr pg*P1 1
 ..
+.\" Establish traps for the bottom of the text area and the footer line.
+.\" Various macros move them, but pg@top restores them at each new page.
 .wh -\n[FM]u pg@bottom
-.wh -\n[FM]u/2u pg*footer
+.wh -\n[FM]u/2u-1v pg*footer
 .nr MINGW 2n
 .nr pg@ncols 1
 .de @MC
@@ -618,7 +620,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .      pl \\n[nl]u
 .      ab
 .\}
-.ch pg*footer -\\n[FM]u/2u
+.ch pg*footer -\\n[FM]u/2u-1v
 .nr pg*col-num 0
 .nr pg@fn-bottom-margin 0
 .po \\n[PO]u
diff --git a/tmac/tests/s_vertical-margins-are-correct.sh 
b/tmac/tests/s_vertical-margins-are-correct.sh
index 1ee071e1b..25e0f08d4 100755
--- a/tmac/tests/s_vertical-margins-are-correct.sh
+++ b/tmac/tests/s_vertical-margins-are-correct.sh
@@ -112,7 +112,7 @@ echo "$output" | grep -q '^ *57[     ]*sint et molestiae' 
|| wail
 
 echo "checking for footer on correct output line" >&2
 # That's [tab space] on the next line.
-echo "$output" | grep -qx ' *64[        ]*Footer' || wail
+echo "$output" | grep -qx ' *63[        ]*Footer' || wail
 
 # ...with titles and a short footnote...
 
@@ -143,7 +143,7 @@ echo "$output" | grep -q ' *60[      ]*.*short footnote' || 
wail
 
 echo "checking for footer on correct output line" >&2
 # That's [tab space] on the next line.
-echo "$output" | grep -qx ' *64[        ]*Footer' || wail
+echo "$output" | grep -qx ' *63[        ]*Footer' || wail
 
 # ...and with titles and a longer footnote.
 
@@ -176,7 +176,7 @@ echo "$output" | grep -q ' *57[      ]*.*longer footnote' 
|| wail
 
 echo "checking for footer on correct output line" >&2
 # That's [tab space] on the next line.
-echo "$output" | grep -qx ' *64[        ]*Footer' || wail
+echo "$output" | grep -qx ' *63[        ]*Footer' || wail
 
 test -z "$fail"
 

_______________________________________________
groff-commit mailing list
groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to