groff-commit
[Top][All Lists]
Advanced

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

[groff] 123/127: [man, mdoc]: Parameterize page offset.


From: G. Branden Robinson
Subject: [groff] 123/127: [man, mdoc]: Parameterize page offset.
Date: Mon, 10 Jul 2023 04:31:09 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit b910ab41d78062a2bf03d69c8a3bd8d1a78a6525
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Jun 8 01:03:11 2023 -0500

    [man, mdoc]: Parameterize page offset.
    
    * tmac/mdoc/doc-ditroff (doc-setup-page-layout):
    * tmac/mdoc/doc-nroff (doc-setup-page-layout):  Stop forcing the page
      offset to the device defaults, redundantly.
    
    * tmac/an.tmac:
    * tmac/mdoc/doc-ditroff (doc-setup-page-layout):
    * tmac/mdoc/doc-nroff (doc-setup-page-layout):  Honor `PO` register if
      set at startup.
    
    * tmac/groff_man.7.man.in (Options):
    * tmac/groff_mdoc.7.man (Options): Document it.
    
    * NEWS: Add item.
---
 ChangeLog               | 18 ++++++++++++++++++
 NEWS                    |  3 +++
 tmac/an.tmac            |  4 ++++
 tmac/groff_man.7.man.in |  7 +++++++
 tmac/groff_mdoc.7.man   |  9 +++++++++
 tmac/mdoc/doc-ditroff   |  5 +++--
 tmac/mdoc/doc-nroff     |  5 +++--
 7 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 835a9054e..4389f8b84 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2023-06-08  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [man, mdoc]: Parameterize page offset.
+
+       * tmac/mdoc/doc-ditroff (doc-setup-page-layout):
+       * tmac/mdoc/doc-nroff (doc-setup-page-layout):  Stop forcing the
+       page offset to the device defaults, redundantly.
+
+       * tmac/an.tmac:
+       * tmac/mdoc/doc-ditroff (doc-setup-page-layout):
+       * tmac/mdoc/doc-nroff (doc-setup-page-layout):  Honor `PO`
+       register if set at startup.
+
+       * tmac/groff_man.7.man.in (Options):
+       * tmac/groff_mdoc.7.man (Options): Document it.
+
+       * NEWS: Add item.
+
 2023-06-02  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        Slightly refactor.
diff --git a/NEWS b/NEWS
index 0cb1bc7ca..7a336ea0f 100644
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,9 @@ o New parameters tunable with the GNU eqn "set" primitive, 
"half_space"
 Macro packages
 --------------
 
+o The an (man) and doc (mdoc) macro packages now support a `PO` register
+  to configure the page offset used by the formatter.
+
 o The new macro file "koi8-r.tmac" supports the KOI8-R character
   encoding, which supports the new Russian locale for groff.
 
diff --git a/tmac/an.tmac b/tmac/an.tmac
index 1ac9550d5..33e88be62 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -1479,6 +1479,10 @@ contains unsupported escape sequence
 .  \}
 .\}
 .
+.\" page offset
+.if r PO \
+.  po \n[PO]u
+.
 .\" type size
 .if !r S \{\
 .  nr S 10
diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index f98bee67f..da59d2fd0 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -3551,6 +3551,13 @@ The default is\~1.
 .
 .
 .TP
+.BI \-rPO= page-offset
+Set page offset;
+the default is 0 for terminal devices
+and 1i for typesetting devices.
+.
+.
+.TP
 .BI \-rS type-size
 Use
 .I type-size
diff --git a/tmac/groff_mdoc.7.man b/tmac/groff_mdoc.7.man
index d161c863a..e613b58cf 100644
--- a/tmac/groff_mdoc.7.man
+++ b/tmac/groff_mdoc.7.man
@@ -5123,6 +5123,15 @@ The default is\~1.
 .
 .
 .Pp
+The
+.Ql PO
+register configures the page offset.
+.
+The default is device-dependent;
+typically 0 for terminal devices and 1i otherwise.
+.
+.
+.Pp
 To change the document font size to 11p or 12p,
 set register
 .Ql S
diff --git a/tmac/mdoc/doc-ditroff b/tmac/mdoc/doc-ditroff
index 96cb2f725..b77bccda2 100644
--- a/tmac/mdoc/doc-ditroff
+++ b/tmac/mdoc/doc-ditroff
@@ -108,6 +108,9 @@
 .
 .eo
 .de doc-setup-page-layout
+.  if r PO \
+.    po \n[PO]u
+.
 .  ie r LL \
 .    ll \n[LL]u
 .  el \
@@ -118,8 +121,6 @@
 .  el \
 .    lt \n[.l]u
 .
-.  po 1i
-.
 .  nr doc-display-vertical .5v
 .  nr doc-line-length \n[.l]
 ..
diff --git a/tmac/mdoc/doc-nroff b/tmac/mdoc/doc-nroff
index 5167af3ea..2f8a727b2 100644
--- a/tmac/mdoc/doc-nroff
+++ b/tmac/mdoc/doc-nroff
@@ -98,6 +98,9 @@
 .
 .eo
 .de doc-setup-page-layout
+.  if r PO \
+.    po \n[PO]u
+.
 .  ie r LL \
 .    ll \n[LL]u
 .  el \
@@ -108,8 +111,6 @@
 .  el \
 .    lt \n[.l]u
 .
-.  po 0i
-.
 .  nr doc-display-vertical 1v
 .  nr doc-line-length \n[.l]
 ..



reply via email to

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