summaryrefslogtreecommitdiff
path: root/tmac
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2023-01-08 11:13:03 -0600
committerG. Branden Robinson <g.branden.robinson@gmail.com>2023-01-08 16:43:51 -0600
commit82db4baa23d5f41671197ed75613609a0553d42b (patch)
tree542e4f7812b5b0a1b1bbe7687c1275209c55eae5 /tmac
parent519c5837a7daf51d18b0ccba531d3731e57fe7ff (diff)
downloadgroff-git-82db4baa23d5f41671197ed75613609a0553d42b.tar.gz
[man]: Stop SY/YS from re-enabling hyphenation.
* tmac/an-ext.tmac: Move the saving of the hyphenation mode from the "top level" to... (mY): ...this new macro. (SY, mQ, MR): Call `mY` before disabling hyphenation. Problem introduced by me in commit 096c2f0567, 16 February. "an-ext.tmac" gets sourced by "an.tmac" before any command-line setting of the `HY` register is handled, so (for groff) the stored hyphenation mode was the default for the language, not reflecting user disablement. The synopsis macros, which do not have an alternate implementation in "an.tmac" for leverage of groff features, were causing hyphenation to be resurrected (after `YS`) even if the user had disabled it. Saving the hyphenation mode anew upon entry to these macros is arguably inefficient, but it is more correct since a man page could conceivably manipulate the automatic hyphenation mode (even if that's not recommended outside of tbl(1) text blocks).
Diffstat (limited to 'tmac')
-rw-r--r--tmac/an-ext.tmac17
1 files changed, 12 insertions, 5 deletions
diff --git a/tmac/an-ext.tmac b/tmac/an-ext.tmac
index f9fe37306..5035bb292 100644
--- a/tmac/an-ext.tmac
+++ b/tmac/an-ext.tmac
@@ -37,13 +37,17 @@
.ds mC CW
.if n .ds mC R
.
+.\" Save the automatic hyphenation mode.
+.\"
.\" 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
+.\" and no way to save and restore it. Set `mH` to a reasonable value
.\" for your implementation and preference.
-.ie !\n(.g \
-. nr mH 14
-.el \
-. do nr mH \n[.hy]
+.de mY
+. ie !\\n(.g \
+. nr mH 14
+. el \
+. do nr mH \\n[.hy] \" groff extension register
+..
.
.nr mS 0 \" in a synopsis (SY/YS)?
.nr mE 0 \" in an example (EX/EE)?
@@ -52,6 +56,7 @@
.\" Declare start of command synopsis. Sets up hanging indentation.
.de SY
. ie !\\n(mS \{\
+. mY
. nh
. nr mS 1
. nr mA \\n(.j
@@ -90,6 +95,7 @@
.\" Emit hyperlink. The optional argument supplies trailing punctuation
.\" after link text. `ME` and `UE` call this.
.de mQ
+. mY
. nh
<\\*(m1>\\$1
. hy \\n(mH
@@ -132,6 +138,7 @@
.\" .MR page-topic page-section [trailing-text]
.if \n(.g-\n(mG \{\
.de MR
+. mY
. nh
. ie \\n(.$=1 \
. I \\$1