summaryrefslogtreecommitdiffstats
path: root/mandoc.1
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2023-10-24 20:53:12 +0000
committerIngo Schwarze <schwarze@openbsd.org>2023-10-24 20:53:12 +0000
commit91555cb3f3238cb10f575c9191c3c2729c8f9473 (patch)
tree039de9bbee59547678c7bbded6b319d34dcdc4e9 /mandoc.1
parent8a8bc122106d3c6164977db2ba5b07c3e2bf359d (diff)
downloadmandoc-91555cb3f3238cb10f575c9191c3c2729c8f9473.tar.gz
Implement the man(7) .MR macro, a 2023 GNU extension.
The syntax and semantics is almost identical to mdoc(7) .Xr. This will be needed for reading the groff manual pages once our port will be updated to 1.23, and the Linux Manual Pages Project is also determined to start using it sooner or later. I did not advocate for this new macro, but since we want to remain able to read all manual pages found in the wild, there is little choice but to support it. At least it is easy to do, they basically copied .Xr.
Diffstat (limited to 'mandoc.1')
-rw-r--r--mandoc.124
1 files changed, 17 insertions, 7 deletions
diff --git a/mandoc.1 b/mandoc.1
index 106db4b9..780183a2 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -1,6 +1,6 @@
.\" $Id$
.\"
-.\" Copyright (c) 2012, 2014-2022 Ingo Schwarze <schwarze@openbsd.org>
+.\" Copyright (c) 2012, 2014-2023 Ingo Schwarze <schwarze@openbsd.org>
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
@@ -1295,9 +1295,11 @@ The same standard section title occurs more than once.
A standard section header occurs in a section of the manual
where it normally isn't useful.
.It Sy "cross reference to self"
-.Pq mdoc
+.Pq mdoc , man
An
.Ic \&Xr
+or
+.Ic \&MR
macro refers to a name and section matching the section of the present
manual page and a name mentioned in an
.Ic \&Nm
@@ -1616,12 +1618,16 @@ macro is immediately followed by an
macro on the next input line.
Such an empty block does not produce any output.
.It Sy "missing section argument"
-.Pq mdoc
+.Pq mdoc , man
An
.Ic \&Xr
+or
+.Ic \&MR
macro lacks its second, section number argument.
-The first argument, i.e. the name, is printed, but without subsequent
-parentheses.
+The first argument, i.e. the name, is printed, but without a section number.
+In the case of
+.Ic \&Xr ,
+the parentheses are also omitted.
.It Sy "missing -std argument, adding it"
.Pq mdoc
An
@@ -2152,10 +2158,12 @@ request is neither a single ASCII character
nor a single character escape sequence.
All arguments are ignored and printing of a margin character is disabled.
.It Sy "missing manual name, using \(dq\(dq"
-.Pq mdoc
+.Pq mdoc , man
The first call to
.Ic \&Nm ,
-or any call in the NAME section, lacks the required argument.
+or any call in the NAME section, lacks the required argument, or
+.Ic \&MR
+is called without any argument.
.It Sy "uname(3) system call failed, using UNKNOWN"
.Pq mdoc
The
@@ -2283,6 +2291,8 @@ or a request of the
family with more than two arguments
.It
.Ic \&Dt
+or
+.Ic \&MR
with more than three arguments
.It
.Ic \&TH