[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 06/11: [man]: Ignore FT register when appropriate.
From: |
G. Branden Robinson |
Subject: |
[groff] 06/11: [man]: Ignore FT register when appropriate. |
Date: |
Mon, 17 May 2021 23:02:48 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 5a76dfb9c87f6dabc61c6d88e6a5ae616eb05347
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon May 17 18:52:53 2021 +1000
[man]: Ignore FT register when appropriate.
* tmac/an-old.tmac (initialization): Validate user-specified value of
\n[FT]. Continuous rendering ignores FT (page location traps are not
used for footers in that mode). Measuring a footer distance from the
page top isn't done. A footer distance of over half the page length
is unlikely. A footer distance of less than one line height is too.
Issue diagnostics in all of these cases.
Fixes <https://savannah.gnu.org/bugs/index.php?60612>.
---
ChangeLog | 12 ++++++++++++
tmac/an-old.tmac | 37 +++++++++++++++++++++++++++++++++----
2 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 69bb36a..5971c8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,21 @@
2021-05-17 G. Branden Robinson <g.branden.robinson@gmail.com>
+ [man]: Ignore FT register when appropriate.
+
+ * tmac/an-old.tmac (initialization): Validate user-specified
+ value of \n[FT]. Continuous rendering ignores FT (page location
+ traps are not used for footers in that mode). Measuring a
+ footer distance from the page top isn't done. A footer distance
+ of over half the page length is unlikely. A footer distance of
+ less than one line height is too. Issue diagnostics in all of
+ these cases.
+
* tmac/tests/tmac/tests/\
an-old_FT-bad-value-should-not-trash-titles.sh: Test it.
* tmac/tmac.am (tmac_TESTS): Run test.
+ Fixes <https://savannah.gnu.org/bugs/index.php?60612>.
+
2021-05-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (TH): Plant the an-footer trap (where we
diff --git a/tmac/an-old.tmac b/tmac/an-old.tmac
index 56ada26..1a9ccb0 100644
--- a/tmac/an-old.tmac
+++ b/tmac/an-old.tmac
@@ -226,9 +226,11 @@
. an-header
.
. if !\\n[cR] \{\
+. ie r FT .nr an-footer-location \\n[FT]
+. el .nr an-footer-location (-.5i)
. wh 0 an-header
-. wh (2u * \\n[FT]u) an-footer
-. wh \\n[FT]u an-p-footer
+. wh (2u * \\n[an-footer-location]u) an-footer
+. wh \\n[an-footer-location]u an-p-footer
. \}
. \}
.
@@ -772,8 +774,35 @@
. \}
.
.\" footer distance
-.if !r FT \
-. nr FT (-.5i)
+.\"
+.\" Unlike most of these parameters, we do not set a default for FT; the
+.\" TH macro places page location traps only if not continuously
+.\" rendering.
+.\"
+.if r FT \{\
+. \" Validate it. Continuous rendering ignores FT. Measuring a footer
+. \" distance from the page top isn't done. A footer distance of over
+. \" half the page length is unlikely. A footer distance of less than
+. \" one line height is too.
+. ie \n[cR] \
+. ds an-msg footer distance when continuously rendering\"
+. el \{\
+. ie (\n[FT] : (\n[FT] = 0)) \
+. ds an-msg non-negative footer distance: \n[FT]u\"
+. el \{\
+. ie (-(\n[FT]) > (\n[.p] / 2)) \
+. ds an-msg implausibly large footer distance: \n[FT]u\"
+. el \
+. if ((v;\n[FT]) < 1v) \
+. ds an-msg implausibly small footer distance: \n[FT]u\"
+. \}
+. \}
+. if d an-msg \{\
+. tm \*[an-old]: ignoring \*[an-msg]
+. rr FT
+. rm an-msg
+. \}
+.\}
.
.\" hyphenation mode
.if !r HY \{\
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 06/11: [man]: Ignore FT register when appropriate.,
G. Branden Robinson <=