summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-12 12:40:44 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-12 12:40:44 +0000
commit91deb3ada9798193fdc1eea30c75fde0f2a96203 (patch)
tree313fc1f2fa38bd31dabeb137b9b87bc9540f23bd
parent0214fa880cd249945951f08bfcf80004d5e6f43f (diff)
downloadmandoc-91deb3ada9798193fdc1eea30c75fde0f2a96203.tar.gz
mandoc-91deb3ada9798193fdc1eea30c75fde0f2a96203.tar.zst
mandoc-91deb3ada9798193fdc1eea30c75fde0f2a96203.zip
Made per-macro "now callable" COMPATIBILITY claims into a single "most macros callable".
Added COMPATIBILITY note on escaped special-character sequences. Vertical bar now correctly delimits (like in new groff).
-rw-r--r--mdoc.767
-rw-r--r--mdoc_strings.c8
2 files changed, 41 insertions, 34 deletions
diff --git a/mdoc.7 b/mdoc.7
index 65121472..23626653 100644
--- a/mdoc.7
+++ b/mdoc.7
@@ -1,4 +1,4 @@
-.\" $Id: mdoc.7,v 1.27 2009/06/12 09:18:00 kristaps Exp $
+.\" $Id: mdoc.7,v 1.28 2009/06/12 12:40:44 kristaps Exp $
.\"
.\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
.\"
@@ -31,7 +31,12 @@ language is used to format
manuals. In this reference document, we describe the syntax, ontology
and structure of the
.Nm
-language.
+language. Our reference implementation is
+.Xr mandoc 1 .
+The
+.Sx COMPATIBILITY
+section describes compatibility with
+.Xr groff 1 .
.\" PARAGRAPH
.Pp
An
@@ -96,6 +101,8 @@ Within a macro line, the following characters are reserved:
.Pq question
.It \&!
.Pq exclamation
+.It \&|
+.Pq vertical bar
.El
.\" PARAGRAPH
.Pp
@@ -470,27 +477,34 @@ and
macros are obsolete.
.\" SECTION
.Sh COMPATIBILITY
-The mdoc language was traditionally a
-.Qq roff
-macro package; most existing manuals were written with mdoc syntax
-dictated by system-dependent roff installations. This section documents
-compatibility with these systems.
+This section documents compatibility with other roff implementations, at
+this time limited to
+.Xr groff 1 .
+The term
+.Qq historic groff
+refers to those versions before the
+.Pa doc.tmac
+file re-write
+.Pq somewhere between 1.15 and 1.19 .
.Pp
.Bl -dash -compact
.\" LIST-ITEM
.It
-.Sq \&.An ,
-.Sq \&.Fo ,
-.Sq \&.Lk ,
-.Sq \&.Ms ,
-.Sq \&.Mt ,
-and
-.Sq \&.St
-historically weren't callable.
+Historic groff has many un-callable macros. Most of these (excluding
+some block-level macros) are now callable, conforming to the
+non-historic groff version.
+.\" LIST-ITEM
+.It
+The vertical bar
+.Sq \(Ba
+made historic groff
+.Qq go orbital
+but is a proper delimiter in this implementation.
.\" LIST-ITEM
.It
.Sq \&.It \-nested
-is assumed for all lists: any list may be nested and
+is assumed for all lists (it wasn't in historic groff): any list may be
+nested and
.Sq \-enum
lists will restart the sequence only for the sub-list.
.\" LIST-ITEM
@@ -505,26 +519,17 @@ The
macro only accepts a single parameter.
.\" LIST-ITEM
.It
-The system-name macros (
-.Ns Sq \&.At ,
-.Sq \&.Bsx ,
-.Sq \&.Bx ,
-.Sq \&.Fx ,
-.Sq \&.Nx ,
-.Sq \&.Ox ,
-and
-.Sq \&.Ux )
-are callable.
-.\" LIST-ITEM
-.It
Some manuals use
.Sq \&.Li
incorrectly by following it with a reserved character and expecting the
delimiter to render. This is not supported.
.\" LIST-ITEM
.It
-.Sq \&.Cd
-is callable.
+If an special-character control character
+.Sq \e
+is escaped, it will
+obviously not render the sequence. Even newer versions of groff seem to
+dither on this.
.El
.\" SECTION
.Sh SEE ALSO
@@ -538,7 +543,7 @@ utility was written by
.An Kristaps Dzonsons Aq kristaps@kth.se .
.\" SECTION
.Sh CAVEATS
-There are several ambiguous parts of mdoc.
+There are many ambiguous parts of mdoc.
.Pp
.Bl -dash -compact
.\" LIST-ITEM
diff --git a/mdoc_strings.c b/mdoc_strings.c
index afba4a07..a9abe0bf 100644
--- a/mdoc_strings.c
+++ b/mdoc_strings.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_strings.c,v 1.3 2009/04/12 19:45:26 kristaps Exp $ */
+/* $Id: mdoc_strings.c,v 1.4 2009/06/12 12:40:44 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -147,6 +147,8 @@ mdoc_iscdelim(char p)
{
switch (p) {
+ case('|'):
+ /* FALLTHROUGH */
case('.'):
/* FALLTHROUGH */
case(','):
@@ -214,9 +216,9 @@ mdoc_atotime(const char *p)
(void)memset(&tm, 0, sizeof(struct tm));
- if (0 == strcmp(p, "$Mdocdate: April 12 2009 $"))
+ if (0 == strcmp(p, "$Mdocdate: June 12 2009 $"))
return(time(NULL));
- if ((pp = strptime(p, "$Mdocdate: April 12 2009 $", &tm)) && 0 == *pp)
+ if ((pp = strptime(p, "$Mdocdate: June 12 2009 $", &tm)) && 0 == *pp)
return(mktime(&tm));
/* XXX - this matches "June 1999", which is wrong. */
if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp)