groff-commit
[Top][All Lists]
Advanced

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

[groff] 02/12: [mdoc]: Use header/footer space of 1v in nroff.


From: G. Branden Robinson
Subject: [groff] 02/12: [mdoc]: Use header/footer space of 1v in nroff.
Date: Mon, 24 May 2021 13:06:12 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit d33b167406102b8cc197ed2f3e25341905b5edf7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun May 23 19:20:07 2021 +1000

    [mdoc]: Use header/footer space of 1v in nroff.
    
    * tmac/mdoc/doc-common-u: Add comment warning source divers that
      \n[doc-header-space] is re-used for a purpose for which it is
      not documented.
    
    * tmac/mdoc/doc-nroff-u: Initialize doc-{header,footer}-space registers,
      which define the vertical spacing between body text and the relevant
      titles (not between the titles and the page margins) to 1v instead of
      0.5i.  This is what mdoc(7) has always done in practice, per Ingo
      Schwarze.
---
 ChangeLog              | 11 +++++++++++
 tmac/mdoc/doc-common-u |  4 +++-
 tmac/mdoc/doc-nroff-u  |  4 ++--
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 758baf6..c36ac0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2021-05-23  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * tmac/mdoc/doc-common-u: Add comment warning source divers that
+       \n[doc-header-space] is re-used for a purpose for which it is
+       not documented.
+       * tmac/mdoc/doc-nroff-u: Initialize doc-{header,footer}-space
+       registers, which define the vertical spacing between body text
+       and the relevant titles (not between the titles and the page
+       margins) to 1v instead of 0.5i.  This is what mdoc(7) has always
+       done in practice, per Ingo Schwarze.
+
+2021-05-23  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * src/devices/grohtml/post-html.cpp (assert_state::add): Avoid
        potential deallocation of statically-allocated strings.  Use
        strsave() to duplicate them so that they can be safely handed to
diff --git a/tmac/mdoc/doc-common-u b/tmac/mdoc/doc-common-u
index 571f979..29c3f3b 100644
--- a/tmac/mdoc/doc-common-u
+++ b/tmac/mdoc/doc-common-u
@@ -934,8 +934,10 @@
 .de doc-header
 .  ev doc-env-dh
 .  doc-setup-page-layout
-.  if !\n[cR] \
+.  if !\n[cR] \{\
+.    \" Re-use doc-header-space between page top and header.
 .    sp \n[doc-header-space]u
+.  \}
 .  nr doc-reg-dh \w'\*[doc-caption-font]\*[doc-header-string]\f[]'
 .  nr doc-reg-dh1 \w'\*[doc-caption-font2]\*[doc-volume]\f[]'
 .  if (\n[doc-reg-dh] + \n[doc-reg-dh1] + \n[doc-reg-dh] >= \n[.lt]) \{\
diff --git a/tmac/mdoc/doc-nroff-u b/tmac/mdoc/doc-nroff-u
index 059d6a6..f63c8f2 100644
--- a/tmac/mdoc/doc-nroff-u
+++ b/tmac/mdoc/doc-nroff-u
@@ -112,13 +112,13 @@
 .\" NS doc-header-space global register
 .\" NS   the space between header and body
 .
-.nr doc-header-space 0.5i
+.nr doc-header-space 1v
 .
 .
 .\" NS doc-footer-space global register
 .\" NS   the space between body and footer
 .
-.nr doc-footer-space 0.5i
+.nr doc-footer-space 1v
 .
 .
 .\" NS doc-display-vertical global register



reply via email to

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