summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2012-07-09 22:36:05 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2012-07-09 22:36:05 +0000
commiteab3fae2c20e4df0ab568b2c83b6e9d014bb51b6 (patch)
treeb57e762730945ee2d64c9d0d0a3586afba6e8b17
parentd942d005d267c423064b9ab6e3e16b7fdf7e5bb8 (diff)
implement -Tman .Eo and .Ec
-rw-r--r--regress/usr.bin/mandoc/mdoc/Eo/Makefile5
-rw-r--r--regress/usr.bin/mandoc/mdoc/Eo/empty.in15
-rw-r--r--regress/usr.bin/mandoc/mdoc/Eo/empty.out_ascii9
-rw-r--r--regress/usr.bin/mandoc/mdoc/Makefile4
-rw-r--r--usr.bin/mandoc/mdoc_man.c17
5 files changed, 44 insertions, 6 deletions
diff --git a/regress/usr.bin/mandoc/mdoc/Eo/Makefile b/regress/usr.bin/mandoc/mdoc/Eo/Makefile
new file mode 100644
index 00000000000..9483beafc90
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Eo/Makefile
@@ -0,0 +1,5 @@
+# $OpenBSD: Makefile,v 1.1 2012/07/09 22:36:04 schwarze Exp $
+
+REGRESS_TARGETS = empty
+
+.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Eo/empty.in b/regress/usr.bin/mandoc/mdoc/Eo/empty.in
new file mode 100644
index 00000000000..76a3ed03809
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Eo/empty.in
@@ -0,0 +1,15 @@
+.Dd October 21, 2010
+.Dt EO-EMPTY 1
+.Os OpenBSD
+.Sh NAME
+.Nm Eo-empty
+.Nd empty implicit enclosure macros
+.Sh DESCRIPTION
+An empty
+.Eo <<
+.Ec >>
+and a full
+.Eo <<
+user@host
+.Ec >>
+quotation.
diff --git a/regress/usr.bin/mandoc/mdoc/Eo/empty.out_ascii b/regress/usr.bin/mandoc/mdoc/Eo/empty.out_ascii
new file mode 100644
index 00000000000..21e9d9b2754
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Eo/empty.out_ascii
@@ -0,0 +1,9 @@
+EO-EMPTY(1) OpenBSD Reference Manual EO-EMPTY(1)
+
+NNAAMMEE
+ EEoo--eemmppttyy - empty implicit enclosure macros
+
+DDEESSCCRRIIPPTTIIOONN
+ An empty <<>> and a full <<user@host>> quotation.
+
+OpenBSD October 21, 2010 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Makefile b/regress/usr.bin/mandoc/mdoc/Makefile
index 9e468b38957..08dae938b95 100644
--- a/regress/usr.bin/mandoc/mdoc/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.22 2012/07/09 17:52:09 schwarze Exp $
+# $OpenBSD: Makefile,v 1.23 2012/07/09 22:36:04 schwarze Exp $
-SUBDIR += Ad An Ap Aq Ar At Bd Bk Bl Brq Bx Cd Cm D1 Dl Dq Dv Er Ev Fl Fo
+SUBDIR += Ad An Ap Aq Ar At Bd Bk Bl Brq Bx Cd Cm D1 Dl Dq Dv Eo Er Ev Fl Fo
SUBDIR += Ic In Lb Lk Li Ms Mt Nd Nm No Ns Oo Op Ox Pa Pf Pp Qq Rs
SUBDIR += Sm Sq St Sx Sy Tn Ux Va Vt Xr blank
diff --git a/usr.bin/mandoc/mdoc_man.c b/usr.bin/mandoc/mdoc_man.c
index 91f67d81626..e5646d02dc5 100644
--- a/usr.bin/mandoc/mdoc_man.c
+++ b/usr.bin/mandoc/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_man.c,v 1.25 2012/07/09 18:55:40 schwarze Exp $ */
+/* $Id: mdoc_man.c,v 1.26 2012/07/09 22:36:04 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -44,6 +44,7 @@ static void post_bf(DECL_ARGS);
static void post_bk(DECL_ARGS);
static void post_dl(DECL_ARGS);
static void post_enc(DECL_ARGS);
+static void post_eo(DECL_ARGS);
static void post_fa(DECL_ARGS);
static void post_fl(DECL_ARGS);
static void post_fn(DECL_ARGS);
@@ -165,10 +166,10 @@ static const struct manact manacts[MDOC_MAX + 1] = {
{ NULL, NULL, NULL, NULL, NULL }, /* Dc */
{ cond_body, pre_enc, post_enc, "``", "''" }, /* Do */
{ cond_body, pre_enc, post_enc, "``", "''" }, /* Dq */
- { NULL, NULL, NULL, NULL, NULL }, /* _Ec */
- { NULL, NULL, NULL, NULL, NULL }, /* _Ef */
+ { NULL, NULL, NULL, NULL, NULL }, /* Ec */
+ { NULL, NULL, NULL, NULL, NULL }, /* Ef */
{ NULL, pre_em, post_font, NULL, NULL }, /* Em */
- { NULL, NULL, NULL, NULL, NULL }, /* _Eo */
+ { NULL, NULL, post_eo, NULL, NULL }, /* Eo */
{ NULL, pre_ux, NULL, "FreeBSD", NULL }, /* Fx */
{ NULL, pre_sy, post_font, NULL, NULL }, /* Ms */
{ NULL, pre_no, NULL, NULL, NULL }, /* No */
@@ -752,6 +753,14 @@ pre_em(DECL_ARGS)
return(1);
}
+static void
+post_eo(DECL_ARGS)
+{
+
+ if (MDOC_HEAD == n->type || MDOC_BODY == n->type)
+ outflags &= ~MMAN_spc;
+}
+
static int
pre_fa(DECL_ARGS)
{