[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 02/02: [man]: Fix `U` enablement override.
From: |
G. Branden Robinson |
Subject: |
[groff] 02/02: [man]: Fix `U` enablement override. |
Date: |
Fri, 1 Oct 2021 09:43:34 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 917f0f264a92cf3812589d04a1f1435900a60c6f
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Oct 1 23:03:55 2021 +1000
[man]: Fix `U` enablement override.
... so it actually works the way I had in mind.
- The package proper enables it by default, but
- the sample site configuration file switches it off, on the assumption
that distributors and users will know better than we do when they get
a capable pager in place, and
- a register setting at the command line (or otherwise prior to the
loading of the macro package) is dispositive.
* tmac/an-ext.tmac: Rename URI output device capability register from
`U` to `mU`.
(UR, UE, MT, ME): Test both `U` and `mU` before handling hyperlinks
specially.
* tmac/an.tmac: If `man.local` did not initialize `U`, switch it on.
The hope is that we can drop the stuff in `man.local` completely at
some point.
* tman/man.local: Only initialize `U` if it is not already defined.
---
ChangeLog | 21 +++++++++++++++++++++
tmac/an-ext.tmac | 14 +++++++-------
tmac/an.tmac | 4 ++++
tmac/man.local | 3 ++-
4 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ece54c1..64123bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,26 @@
2021-10-01 G. Branden Robinson <g.branden.robinson@gmail.com>
+ [man]: Fix `U` enablement override so it actually works the way
+ I had in mind.
+ - The package proper enables it by default, but
+ - the sample site configuration file switches it off, on the
+ assumption that distributors and users will know better than
+ we do when they get a capable pager in place, and
+ - a register setting at the command line (or otherwise prior to
+ the loading of the macro package) is dispositive.
+
+ * tmac/an-ext.tmac: Rename URI output device capability register
+ from `U` to `mU`.
+ (UR, UE, MT, ME): Test both `U` and `mU` before handling
+ hyperlinks specially.
+ * tmac/an.tmac: If `man.local` did not initialize `U`, switch it
+ on. The hope is that we can drop the stuff in `man.local`
+ completely at some point.
+ * tman/man.local: Only initialize `U` if it is not already
+ defined.
+
+2021-10-01 G. Branden Robinson <g.branden.robinson@gmail.com>
+
[man]: Use OSC 8 hyperlinks.
* tmac/an-ext.tmac: Add registers `mY` (output driver is
diff --git a/tmac/an-ext.tmac b/tmac/an-ext.tmac
index 4726e77..7a45222 100644
--- a/tmac/an-ext.tmac
+++ b/tmac/an-ext.tmac
@@ -29,13 +29,13 @@
.\" Check if we're using grohtml or grotty, and therefore support URIs.
.nr mH 0
.nr mY 0
-.nr U 0
+.nr mU 0
.if \n(.g \{\
. if '\*(.T'html' \
. nr mH 1
. if '\*(.T'utf8' \
. nr mY 1
-. nr U \n(mH+\n(mY
+. nr mU \n(mH+\n(mY
.\}
.
.
@@ -94,7 +94,7 @@
.\" Start URL.
.de UR
. ds m1 \\$1\"
-. if \\nU \{\
+. if \\nU&\\n(mU \{\
. \" Start diversion in a new environment.
. do ev link-text-env
. do di link-text-div
@@ -104,7 +104,7 @@
.
.\" End URL.
.de UE
-. ie \\nU \{\
+. ie \\nU&\\n(mU \{\
. br
. di
. ev
@@ -145,7 +145,7 @@
.\" Start email address.
.de MT
. ds m1 \\$1\"
-. if \\nU \{\
+. if \\nU&\\n(mU \{\
. \" Start diversion in a new environment.
. do ev link-text-env
. do di link-text-div
@@ -155,7 +155,7 @@
.
.\" End email address.
.de ME
-. ie \\nU \{\
+. ie \\nU&\\n(mU \{\
. br
. di
. ev
@@ -166,7 +166,7 @@
\X^html:<a href="mailto:\\*(m1">^\c
. if \\n(mY \
\X^tty: link mailto:\\*(m1^\c
-. \" Yes, strip off final newline of diversion and emit it.
+. \" Strip off the final newline of the diversion and emit it.
. do chop link-text-div
. do link-text-div
\c
diff --git a/tmac/an.tmac b/tmac/an.tmac
index 400f7ba..e3a406d 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -1044,6 +1044,10 @@
.if !r SN \
. nr SN 3n
.
+.\" URI enablement
+.if !r U \
+. nr U 1
+.
.\" page number after which to apply letter suffixes
.\"
.\" Unlike most of these parameters, we do not set a default for X; only
diff --git a/tmac/man.local b/tmac/man.local
index 83cec5c..8c0808b 100644
--- a/tmac/man.local
+++ b/tmac/man.local
@@ -6,4 +6,5 @@
.\" Change "0" to "1" to enable OSC 8 links on SGR-capable grotty(1)
.\" output devices.
.if !'\*[.T]'html' \
-. nr U 0
+. if !r U \
+. nr U 0
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 02/02: [man]: Fix `U` enablement override.,
G. Branden Robinson <=