[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 07/10: [man]: Trivially refactor (rename some strings).
From: |
G. Branden Robinson |
Subject: |
[groff] 07/10: [man]: Trivially refactor (rename some strings). |
Date: |
Thu, 7 Apr 2022 19:03:10 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 94d0c83ab8ab4269b813ce1845f6099c8f01cdbe
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Apr 8 06:13:18 2022 +1000
[man]: Trivially refactor (rename some strings).
* tmac/an.tmac: Trivially refactor. Rename strings `an-ifoot` to
`an*ifoot` and `an-outer-footer-text` to `an*ofoot`.
---
ChangeLog | 5 +++++
tmac/an.tmac | 60 ++++++++++++++++++++++++++++++------------------------------
2 files changed, 35 insertions(+), 30 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5ee9995d..f1498d39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-04-08 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * tmac/an.tmac: Trivially refactor. Rename strings `an-ifoot`
+ to `an*ifoot` and `an-outer-footer-text` to `an*ofoot`.
+
2022-04-08 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an.tmac: Refactor. Abbreviate page title and inner
diff --git a/tmac/an.tmac b/tmac/an.tmac
index 3d44ae67..26ff1643 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -419,11 +419,11 @@
.de1 BT
. if \\n[cR] .pl +1v
. ie \\n[D] \{\
-. if o .tl '\\*[an-ifoot]'\\*[an-extra1]'\\*[an-outer-footer-text]'
-. if e .tl '\\*[an-outer-footer-text]'\\*[an-extra1]'\\*[an-ifoot]'
+. if o .tl '\\*[an*ifoot]'\\*[an-extra1]'\\*[an*ofoot]'
+. if e .tl '\\*[an*ofoot]'\\*[an-extra1]'\\*[an*ifoot]'
. \}
. el \
-. tl '\\*[an-ifoot]'\\*[an-extra1]'\\*[an-outer-footer-text]'
+. tl '\\*[an*ifoot]'\\*[an-extra1]'\\*[an*ofoot]'
..
.
.\" Abbreviate the page title if it's too long for the header. Leaves
@@ -479,13 +479,13 @@
.
.\" Abbreviate the `an-extra2` string (set by .TH) if it's too long for
.\" the footer. By default, `an-extra2` is placed as the inner footer.
-.\" We call it `an-ifoot` here and leave it defined for .BT use.
+.\" We call it `an*ifoot` here and leave it defined for .BT use.
.\"
.\" The method here differs from an*abbreviate-page-title, because the
.\" (default) header is symmetrical, with `an-pageref` on both sides,
.\" whereas the (default) footer is not. Our approach is to chop
.\" `an-extra1` (the default center footer) in half and ensure that the
-.\" formatted `an-ifoot` plus that is less than half the title length.
+.\" formatted `an*ifoot` plus that is less than half the title length.
.de an*abbreviate-inner-footer
. ds an-half-cfoot \\*[an-extra1]\"
. length an-half-cfoot-length \\*[an-half-cfoot]
@@ -494,44 +494,44 @@
. substring an-half-cfoot 0 \\n[an-half-cfoot-length]
. \}
. rr an-half-cfoot-length
-. ds an-ifoot \\*[an-extra2]\"
+. ds an*ifoot \\*[an-extra2]\"
. nr an-half-title-width (\\n[.lt] / 2u)
-. nr an-half-footer-width \\w'\\*[an-ifoot]\\*[an-half-cfoot]'
+. nr an-half-footer-width \\w'\\*[an*ifoot]\\*[an-half-cfoot]'
. \" If abbreviation is not necessary, skip the remaining work.
. if (\\n[an-half-footer-width] <= \\n[an-half-title-width]) .return
. ds an-ellipsis \|.\|.\|.\|\"
. \" Now divide the inner footer in half.
-. length an-ifoot-length \\*[an-ifoot]
-. nr an-mark1 (\\n[an-ifoot-length] / 2)
-. nr an-mark2 (\\n[an-ifoot-length] / 2 + 1)
-. rr an-ifoot-length
-. ds an-ifoot-half1 \\*[an-ifoot]\"
-. ds an-ifoot-half2 \\*[an-ifoot]\"
-. substring an-ifoot-half1 0 \\n[an-mark1]
-. substring an-ifoot-half2 \\n[an-mark2] -1
+. length an*ifoot-length \\*[an*ifoot]
+. nr an-mark1 (\\n[an*ifoot-length] / 2)
+. nr an-mark2 (\\n[an*ifoot-length] / 2 + 1)
+. rr an*ifoot-length
+. ds an*ifoot-half1 \\*[an*ifoot]\"
+. ds an*ifoot-half2 \\*[an*ifoot]\"
+. substring an*ifoot-half1 0 \\n[an-mark1]
+. substring an*ifoot-half2 \\n[an-mark2] -1
. rr an-mark1
. rr an-mark2
. \" Reduce the two halves until, when rejoined with each other, the
. \" ellipsis, and half of the center footer, they fit the half-title.
-. nr an-half-footer-width \\w'\\*[an-ifoot-half1]\\*[an-ellipsis]\
-\\*[an-ifoot-half2]\\*[an-half-cfoot]'
+. nr an-half-footer-width \\w'\\*[an*ifoot-half1]\\*[an-ellipsis]\
+\\*[an*ifoot-half2]\\*[an-half-cfoot]'
. while (\\n[an-half-footer-width] > \\n[an-half-title-width]) \{\
-. length an-half1-length \\*[an-ifoot-half1]
-. length an-half2-length \\*[an-ifoot-half2]
+. length an-half1-length \\*[an*ifoot-half1]
+. length an-half2-length \\*[an*ifoot-half2]
. \" Give up if we'd have to trim ifoot's first or last characters.
. if ((\\n[an-half1-length] = 1) : (\\n[an-half2-length] = 1)) \
. break
. \" Trim a character from half1's end and half2's beginning.
-. substring an-ifoot-half1 0 (\\n[an-half1-length] - 2)
-. substring an-ifoot-half2 2 (\\n[an-half2-length] - 1)
-. nr an-half-footer-width \\w'\\*[an-ifoot-half1]\\*[an-ellipsis]\
-\\*[an-ifoot-half2]\\*[an-half-cfoot]'
+. substring an*ifoot-half1 0 (\\n[an-half1-length] - 2)
+. substring an*ifoot-half2 2 (\\n[an-half2-length] - 1)
+. nr an-half-footer-width \\w'\\*[an*ifoot-half1]\\*[an-ellipsis]\
+\\*[an*ifoot-half2]\\*[an-half-cfoot]'
. \}
-. ds an-ifoot \\*[an-ifoot-half1]\\*[an-ellipsis]\\*[an-ifoot-half2]\"
+. ds an*ifoot \\*[an*ifoot-half1]\\*[an-ellipsis]\\*[an*ifoot-half2]\"
. rr an-half1-length
. rr an-half2-length
-. rm an-ifoot-half1
-. rm an-ifoot-half2
+. rm an*ifoot-half1
+. rm an*ifoot-half2
. rr an-half-footer-width
. rr an-half-title-width
. rm an-ellipsis
@@ -558,18 +558,18 @@
. if \\n[an-suppress-header-and-footer] .return
. ev an*env-header-and-footer
. ie \\n[cR] \
-. ds an-outer-footer-text "\\*[an-pageref]\"
+. ds an*ofoot "\\*[an-pageref]\"
. el \{\
-. ds an-outer-footer-text \\n[%]\"
+. ds an*ofoot \\n[%]\"
. if r X \{\
. if (\\n[%] > \\n[X]) \{\
. nr an-page-letter (\\n[%] - \\n[X])
-. ds an-outer-footer-text \\n[X]\\n[an-page-letter]\"
+. ds an*ofoot \\n[X]\\n[an-page-letter]\"
. \}
. \}
. \}
. BT
-. rm an-outer-footer-text
+. rm an*ofoot
. ev
..
.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 07/10: [man]: Trivially refactor (rename some strings).,
G. Branden Robinson <=