[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 17/28: [man]: Accept `MR` calls with only one argument.
From: |
G. Branden Robinson |
Subject: |
[groff] 17/28: [man]: Accept `MR` calls with only one argument. |
Date: |
Mon, 4 Mar 2024 07:42:38 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit eaa4ba6c9a1c0c8ce5bd9b4dc5cc86aa09f061de
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Mar 3 21:08:48 2024 -0600
[man]: Accept `MR` calls with only one argument.
* tmac/an.tmac (MR): If only one argument is present, do not hyperlink
it, but do set it with italic corrections. Prompted by a similar
change Deri James applied in doc/GMPfront.t.in, and for consistency
with the way we've long handled the analogous `Xr` macro in mdoc(7).
* tmac/groff_man.7.man.in (Hyperlink macros) <MR>: Update macro synopsis
and description.
---
ChangeLog | 12 ++++++++++++
tmac/an.tmac | 38 +++++++++++++++++++++-----------------
tmac/groff_man.7.man.in | 9 ++++++---
3 files changed, 39 insertions(+), 20 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9c12ac9bb..52d96421f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2024-03-03 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [man]: Accept `MR` calls with only one argument.
+
+ * tmac/an.tmac (MR): If only one argument is present, do not
+ hyperlink it, but do set it with italic corrections. Prompted
+ by a similar change Deri James applied in doc/GMPfront.t.in, and
+ for consistency with the way we've long handled the analogous
+ `Xr` macro in mdoc(7).
+ * tmac/groff_man.7.man.in (Hyperlink macros) <MR>: Update macro
+ synopsis and description.
+
2024-03-03 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/pdf.tmac: Add internal flag register
diff --git a/tmac/an.tmac b/tmac/an.tmac
index 3ac8326c0..cc063a25e 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -1290,25 +1290,29 @@ contains unsupported escape sequence
. if (\\n[an*MR-URL-format] = 4) \
. ds an*url x-man-doc://\\$2/\\$1(\\$2)\"
. nh
-. if \\n[an*do-hyperlink] \{\
-. if '\*[.T]'html' \
-. nop \X'html:<a href="\\*[an*url]">'\c
-. if '\*[.T]'pdf' \{\
-. nop \&\m[\\*[PDFHREF.TEXT.COLOUR]]\c
-. pdfhref W -D \\*[an*url] -- "|"
+. ie (\\n[.$] = 1) \
+. nop \&\\*[an-lic]\f[\\*[MF]]\\$1\\*[an-ic]\f[]\c
+. el \{\
+. if \\n[an*do-hyperlink] \{\
+. if '\*[.T]'html' \
+. nop \X'html:<a href="\\*[an*url]">'\c
+. if '\*[.T]'pdf' \{\
+. nop \&\m[\\*[PDFHREF.TEXT.COLOUR]]\c
+. pdfhref W -D \\*[an*url] -- "|"
+. \}
+. if \\n[an*is-output-terminal] \
+. nop \X'tty: link \\*[an*url]'\c
. \}
-. if \\n[an*is-output-terminal] \
-. nop \X'tty: link \\*[an*url]'\c
-. \}
-. nop \&\\*[an-lic]\f[\\*[MF]]\\$1\\*[an-ic]\f[R](\\$2)\c
-. if \\n[an*do-hyperlink] \{\
-. if '\*[.T]'html' \
-. nop \X'html:</a>'\c
-. if '\*[.T]'pdf' \{\
-. nop \X'pdf: markend'\m[default]\c
+. nop \&\\*[an-lic]\f[\\*[MF]]\\$1\\*[an-ic]\f[R](\\$2)\c
+. if \\n[an*do-hyperlink] \{\
+. if '\*[.T]'html' \
+. nop \X'html:</a>'\c
+. if '\*[.T]'pdf' \{\
+. nop \X'pdf: markend'\m[default]\c
+. \}
+. if \\n[an*is-output-terminal] \
+. nop \X'tty: link'\c
. \}
-. if \\n[an*is-output-terminal] \
-. nop \X'tty: link'\c
. \}
. nop \&\\$3
. hy \\n[an*hyphenation-mode]
diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 4f0142aa7..ea94a1122 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -1400,8 +1400,8 @@ to output drivers.
.
.
.TP
-.BI .MR "\~topic manual-section"\c
-.RI \~[ trailing-text ]
+.BI .MR \~topic\c
+.RI \~[ manual-section \~[ trailing-text ]]
.IR (since\~ groff \~1.23) \" TODO: remove note once novelty dies down
Set a man page cross reference as
\[lq]\c
@@ -1421,7 +1421,10 @@ is set in the font specified by the
.B MF
string.
.
-The cross reference hyperlinks to a URI of the form
+If
+.I manual-section
+is present,
+the cross reference hyperlinks to a URI of the form
.RB \[lq] man:\c
.IR topic ( manual-section )\[rq].
_ifstyle()dnl
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 17/28: [man]: Accept `MR` calls with only one argument.,
G. Branden Robinson <=