[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 07/07: [ms]: Fix Savannah #59604.
From: |
G. Branden Robinson |
Subject: |
[groff] 07/07: [ms]: Fix Savannah #59604. |
Date: |
Fri, 11 Jun 2021 01:31:06 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 6a505946b5036f2b149d3a3e5c86f5ceb9f1c3fc
Author: Tadziu Hoffmann <hoffmann@usm.uni-muenchen.de>
AuthorDate: Sat Aug 18 04:23:00 2018 +1000
[ms]: Fix Savannah #59604.
Indent an IP paragraph based on the type size of the paragraph text, not
a preceding heading. We have to delay evaluating IP's argument until
the font size has been reset, which I've attempted to do by simply
passing the argument unevaluated down the call hierarchy, instead of
saving it in a number register right away, as appears customary in this
ms implementation.
However, par@reset is called from a great number of places, and these
usually set the indent registers beforehand. I've left this as it is,
so now two ways of setting the indents exist: via register and
optionally via argument.
* tmac/s.tmac (par@reset): Move font-size setting stuff before
indent-setting stuff; set registers from optional arguments with
default "n" scaling indicator before setting indents.
(par*start, par@finish): Don't set registers, but instead pass
arguments to par@reset.
(@IP): Pass argument unevaluated to par*start.
[Thanks to T. Kurt Bond for updating the patch and championing the
resolution of this bug! --GBR]
---
ChangeLog | 22 ++++++++++++++++++++++
tmac/s.tmac | 33 ++++++++++++++++++---------------
2 files changed, 40 insertions(+), 15 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a5de7f2..687be07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
2021-06-11 Tadziu Hoffmann <hoffmann@usm.uni-muenchen.de>
+ Fix Savannah #59604. Indent an IP paragraph based on the type
+ size of the paragraph text, not a preceding heading. We have to
+ delay evaluating IP's argument until the font size has been
+ reset, which I've attempted to do by simply passing the argument
+ unevaluated down the call hierarchy, instead of saving it in a
+ number register right away, as appears customary in this ms
+ implementation.
+
+ However, par@reset is called from a great number of places,
+ and these usually set the indent registers beforehand.
+ I've left this as it is, so now two ways of setting the
+ indents exist: via register and optionally via argument.
+
+ * tmac/s.tmac (par@reset): Move font-size setting stuff before
+ indent-setting stuff; set registers from optional arguments with
+ default "n" scaling indicator before setting indents.
+ (par*start, par@finish): Don't set registers, but instead pass
+ arguments to par@reset.
+ (@IP): Pass argument unevaluated to par*start.
+
+2021-06-11 Tadziu Hoffmann <hoffmann@usm.uni-muenchen.de>
+
* tmac/s.tmac (@QP, @XP): Be more scrupulous about using "u"
scaling indicator.
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 0b47a6e..d89623d 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -1214,15 +1214,6 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.rj 0
.ul 0
.fi
-.ie \\n[pg@ncols]>1 \{\
-. ll (u;\\n[\\n[.ev]:MCLL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
-. lt \\n[\\n[.ev]:MCLT]u
-.\}
-.el \{\
-. ll (u;\\n[\\n[.ev]:LL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
-. lt \\n[\\n[.ev]:LT]u
-.\}
-.in (u;\\n[\\n[.ev]:li]+\\n[\\n[.ev]:pli])
.ft 1
.ie '\\n[.ev]'fn' .fam \\*[fn@font-family]
.el .fam \\*[FAM]
@@ -1235,6 +1226,17 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.el \
. par*vs \\n[\\n[.ev]:VS]
.ls 1
+.if !'\\$1'' .nr \\n[.ev]:pli (n;\\$1)
+.if !'\\$2'' .nr \\n[.ev]:pri (n;\\$2)
+.ie \\n[pg@ncols]>1 \{\
+. ll (u;\\n[\\n[.ev]:MCLL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
+. lt \\n[\\n[.ev]:MCLT]u
+.\}
+.el \{\
+. ll (u;\\n[\\n[.ev]:LL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
+. lt \\n[\\n[.ev]:LT]u
+.\}
+.in (u;\\n[\\n[.ev]:li]+\\n[\\n[.ev]:pli])
.TA
.hy \\n[HY]
..
@@ -1249,9 +1251,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.
.de par*start
.ds@auto-end
-.nr \\n[.ev]:pli \\$1
-.nr \\n[.ev]:pri \\$2
-.par@reset
+.par@reset \\$1 \\$2
.sp \\n[\\n[.ev]:PD]u
.ne \\n[PORPHANS]v+\\n(.Vu
..
@@ -1259,7 +1259,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
.nr \\n[.ev]:pli 0
.nr \\n[.ev]:pri 0
-.par@reset
+.par@reset 0 0
..
.als @RT par@finish
.\" normal LP
@@ -1281,8 +1281,11 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.ti -\\n[\\n[.ev]:PI]u
..
.de @IP
-.if \\n[.$]>1 .nr \\n[.ev]:ai (n;\\$2)
-.par*start \\n[\\n[.ev]:ai] 0
+.ie \\n[.$]>1 \{\
+.par*start \\$2 0
+.nr \\n[.ev]:ai \\n[\\n[.ev]:pli]
+.\}
+.el .par*start \\n[\\n[.ev]:ai]u 0
.if !'\\$1'' \{\
. \" Divert the label so as to freeze any spaces.
. di par*label
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 07/07: [ms]: Fix Savannah #59604.,
G. Branden Robinson <=