[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 14/35: tmac/an-ext.tmac: Slightly refactor hyphenation.
From: |
G. Branden Robinson |
Subject: |
[groff] 14/35: tmac/an-ext.tmac: Slightly refactor hyphenation. |
Date: |
Mon, 21 Feb 2022 06:15:54 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 096c2f056746f4fd0de3ed7e060c58e5e8d6afb5
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Feb 16 16:03:59 2022 +1100
tmac/an-ext.tmac: Slightly refactor hyphenation.
* tmac/an-ext.tmac: Slightly refactor. Stop using groff's `HY` register
to restore the hyphenation mode, since I plan to change its semantics
to a Boolean value (see Savannah #61734). Introduce new register `mJ`
to store "1" (if not groff) and the current hyphenation mode
otherwise. Explain why in a comment.
(YS, UE, ME, MR): Restore hyphenation mode using `mJ` insted of `HY`.
---
ChangeLog | 10 ++++++++++
tmac/an-ext.tmac | 18 ++++++++++++------
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4474b5a7..eee25d51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-02-16 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * tmac/an-ext.tmac: Slightly refactor. Stop using groff's `HY`
+ register to restore the hyphenation mode, since I plan to change
+ its semantics to a Boolean value (see Savannah #61734).
+ Introduce new register `mJ` to store "1" (if not groff) and the
+ current hyphenation mode otherwise. Explain why in a comment.
+ (YS, UE, ME, MR): Restore hyphenation mode using `mJ` insted of
+ `HY`.
+
2022-02-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-ext.tmac: Trivially refactor. Use a better idiom
diff --git a/tmac/an-ext.tmac b/tmac/an-ext.tmac
index 78af9b4d..15011e53 100644
--- a/tmac/an-ext.tmac
+++ b/tmac/an-ext.tmac
@@ -27,6 +27,14 @@
.if \n(mX>1 \
. nx
.
+.\" In AT&T troff, there was no register exposing the hyphenation mode,
+.\" and no way to save and restore it. Set this to a reasonable value
+.\" for your implementation and preference.
+.ie !\n(.g \
+. nr mJ 1
+.el \
+. do nr mJ \n[.hy]
+.
.\" Check if we're using grohtml or grotty, and therefore support URIs.
.nr mH 0
.nr mY 0
@@ -62,8 +70,6 @@
.el \{\
. ds mL <\"
. ds mR >\"
-. \" groff's man macros control hyphenation with this register.
-. nr HY 1
.\}
.
.nr mS 0
@@ -93,7 +99,7 @@
.de YS
. in \\n(mIu
. ad \\n(mA
-. hy \\n(HY
+. hy \\n(mJ
. nr mS 0
..
.
@@ -148,7 +154,7 @@
. do shift
. ie \n(.g .if \n(.$ \&\\$*\"
. el .if \n(.$>1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9\"
-. hy \\n(HY
+. hy \\n(mJ
. \}
. rr mD
..
@@ -204,7 +210,7 @@
. do shift
. ie \n(.g .if \n(.$ \&\\$*\"
. el .if \n(.$>1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9\"
-. hy \\n(HY
+. hy \\n(mJ
. \}
. rr mD
..
@@ -219,7 +225,7 @@
. I \\$1
. el \
. IR \\$1 (\\$2)\\$3
-. hy \\n(HY
+. hy \\n(mJ
..
.
.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 14/35: tmac/an-ext.tmac: Slightly refactor hyphenation.,
G. Branden Robinson <=