[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 03/10: [mm]: Recognize new vertical spacing register `V`.
From: |
G. Branden Robinson |
Subject: |
[groff] 03/10: [mm]: Recognize new vertical spacing register `V`. |
Date: |
Fri, 5 Aug 2022 03:52:24 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit f17868f6b7c9504b9afc212e47caa0fd4855d437
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Aug 4 13:42:08 2022 -0500
[mm]: Recognize new vertical spacing register `V`.
* contrib/mm/m.tmac (initialization): Recognize new register `V` for
setting the vertical spacing from the command line, instead of blindly
setting the vertical spacing two points larger than the type size.
Handle setting of `V` and type size `S` in case they are given with an
appended scaling unit, using the same technique as groff ms(7)--if the
values are over 1,000, assume that conversion to basic units by the
formatter has already taken place.
* contrib/mm/groff_mm.7.man (Registers) <S, V>: Document it.
* NEWS: Add item.
---
ChangeLog | 4 ++++
NEWS | 6 ++++++
contrib/mm/ChangeLog | 12 ++++++++++++
contrib/mm/groff_mm.7.man | 18 +++++++++++++++---
contrib/mm/m.tmac | 12 +++++++++---
5 files changed, 46 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 41210c21a..2190e5c0a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2022-08-04 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * NEWS: Add item for new groff mm `V` register support.
+
2022-08-04 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/eqn/lex.cpp (do_delim): Recognize "delim on" even
diff --git a/NEWS b/NEWS
index 1aaa63b2b..ec8447044 100644
--- a/NEWS
+++ b/NEWS
@@ -306,6 +306,12 @@ o The e (me) macro package's `$v` and `$V` registers have
been renamed
are expected to set them if desired, unlike other registers and
strings beginning with "$".
+o The m (mm) macro package now recognizes a `V` register to set the
+ vertical spacing for the document. Like the existing `S`, it must be
+ set from the command line. Further, both registers are interpreted
+ correctly if suffixed with a scaling unit, instead of requiring an
+ unscaled value assumed to be points.
+
o The m (mm) macro package now requires a title to be declared when
memorandum type 5 is used (".MT 5"), just as type 4 has since groff
1.10 (November 1995).
diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 8b24f87d8..106ca4a58 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,15 @@
+2022-08-04 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * m.tmac (initialization): Recognize new register `V` for
+ setting the vertical spacing from the command line, instead of
+ blindly setting the vertical spacing two points larger than the
+ type size. Handle setting of `V` and type size `S` in case they
+ are given with an appended scaling unit, using the same
+ technique as groff ms(7)--if the values are over 1,000, assume
+ that conversion to basic units by the formatter has already
+ taken place.
+ * groff_mm.7.man (Registers) <S, V>: Document it.
+
2022-08-03 G. Branden Robinson <g.branden.robinson@gmail.com>
* m.tmac (:P): Define register as an alias of `ft*nr`; the
diff --git a/contrib/mm/groff_mm.7.man b/contrib/mm/groff_mm.7.man
index f46d31464..81bab93ca 100644
--- a/contrib/mm/groff_mm.7.man
+++ b/contrib/mm/groff_mm.7.man
@@ -4429,11 +4429,11 @@ Default is\~0.
.
.TP
.B S
-defines the type size for the document in (scaled) points,
+defines the type size for the document,
and must be set from the command line.
.
-.\" FIXME: This is a defect. It should be 120%.
-The vertical spacing is set two points larger.
+A scaling unit may be appended;
+scaled points are assumed.
.
.
.TP
@@ -4460,6 +4460,18 @@ Display indentation.
.
Default is\~5.
.
+.
+.TP
+.B V
+defines the vertical spacing for the document,
+and must be set from the command line.
+.
+A scaling unit may be appended;
+points are assumed.
+.
+The default vertical spacing is 120% of the type size.
+.
+.
.TP
.B Verbin
Indentation for
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 6cb77bc62..5e95d02de 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -178,10 +178,16 @@ Index array!index
. el .ds @sdf_font R
.\}
.\"
-.\" Current pointsize and vertical space, always in points.
+.\" Set the type size and vertical spacing. If given on the command
+.\" line, these have already been converted to basic units.
.if !r S .nr S 10
-.ps \n[S]
-.vs \n[S]+2
+.ie (\n[S] >= 1000) .ps \n[S]z/1000u
+.el .ps \n[S]
+.nr *vs-default \n[.ps]*120/100
+.if !r V .nr V \n[*vs-default]
+.ie (\n[V] >= 1000) .vs \n[V]p/1000u
+.el .vs \n[V]
+.rm *vs-default
.\"
.nr @ps \n[.ps]
.nr @vs \n[.v]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 03/10: [mm]: Recognize new vertical spacing register `V`.,
G. Branden Robinson <=