summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-06-02 20:16:23 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-06-02 20:16:23 +0000
commit16e0f8afee6d795cdd67eda6de360fc6ae273e59 (patch)
treebefec749f81f3c167017aa93477adf2180c1b8bf
parentfcb1831f437dffe12c02a91668195e01a11fdc86 (diff)
downloadmandoc-16e0f8afee6d795cdd67eda6de360fc6ae273e59.tar.gz
Minimal implementation of .EX and .EE for GNU compatibility.
Do not use this, it is not portable and only defined in esr's man-ext. For example, sox(1) wants these macros.
-rw-r--r--man.712
-rw-r--r--man.c2
-rw-r--r--man.h2
-rw-r--r--man_html.c4
-rw-r--r--man_macro.c2
-rw-r--r--man_term.c4
-rw-r--r--man_validate.c2
7 files changed, 25 insertions, 3 deletions
diff --git a/man.7 b/man.7
index bb907ad4..f4e2b47d 100644
--- a/man.7
+++ b/man.7
@@ -339,6 +339,18 @@ and
.Ss \&DT
Has no effect.
Included for compatibility.
+.Ss \&EE
+This is a non-standard GNU extension, included only for compatibility.
+In
+.Xr mandoc 1 ,
+it does the same as
+.Sx \&fi .
+.Ss \&EX
+This is a non-standard GNU extension, included only for compatibility.
+In
+.Xr mandoc 1 ,
+it does the same as
+.Sx \&nf .
.Ss \&HP
Begin a paragraph whose initial output line is left-justified, but
subsequent output lines are indented, with the following syntax:
diff --git a/man.c b/man.c
index 51a5f72f..016c2167 100644
--- a/man.c
+++ b/man.c
@@ -40,7 +40,7 @@ const char *const __man_macronames[MAN_MAX] = {
"RI", "na", "sp", "nf",
"fi", "RE", "RS", "DT",
"UC", "PD", "AT", "in",
- "ft", "OP"
+ "ft", "OP", "EX", "EE"
};
const char * const *man_macronames = __man_macronames;
diff --git a/man.h b/man.h
index b6ddea17..91975d41 100644
--- a/man.h
+++ b/man.h
@@ -52,6 +52,8 @@ enum mant {
MAN_in,
MAN_ft,
MAN_OP,
+ MAN_EX,
+ MAN_EE,
MAN_MAX
};
diff --git a/man_html.c b/man_html.c
index edf5bb52..ed801c35 100644
--- a/man_html.c
+++ b/man_html.c
@@ -113,6 +113,8 @@ static const struct htmlman mans[MAN_MAX] = {
{ man_in_pre, NULL }, /* in */
{ man_ign_pre, NULL }, /* ft */
{ man_OP_pre, NULL }, /* OP */
+ { man_literal_pre, NULL }, /* EX */
+ { man_literal_pre, NULL }, /* EE */
};
/*
@@ -638,7 +640,7 @@ static int
man_literal_pre(MAN_ARGS)
{
- if (MAN_nf != n->tok) {
+ if (MAN_fi == n->tok || MAN_EE == n->tok) {
print_otag(h, TAG_BR, 0, NULL);
mh->fl &= ~MANH_LITERAL;
} else
diff --git a/man_macro.c b/man_macro.c
index bc56ae4c..15df0ace 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -85,6 +85,8 @@ const struct man_macro __man_macros[MAN_MAX] = {
{ in_line_eoln, 0 }, /* in */
{ in_line_eoln, 0 }, /* ft */
{ in_line_eoln, 0 }, /* OP */
+ { in_line_eoln, MAN_BSCOPE }, /* EX */
+ { in_line_eoln, MAN_BSCOPE }, /* EE */
};
const struct man_macro * const man_macros = __man_macros;
diff --git a/man_term.c b/man_term.c
index 117e5b37..996e507b 100644
--- a/man_term.c
+++ b/man_term.c
@@ -127,6 +127,8 @@ static const struct termact termacts[MAN_MAX] = {
{ pre_in, NULL, MAN_NOTEXT }, /* in */
{ pre_ft, NULL, MAN_NOTEXT }, /* ft */
{ pre_OP, NULL, 0 }, /* OP */
+ { pre_literal, NULL, 0 }, /* EX */
+ { pre_literal, NULL, 0 }, /* EE */
};
@@ -243,7 +245,7 @@ pre_literal(DECL_ARGS)
term_newln(p);
- if (MAN_nf == n->tok)
+ if (MAN_nf == n->tok || MAN_EX == n->tok)
mt->fl |= MANT_LITERAL;
else
mt->fl &= ~MANT_LITERAL;
diff --git a/man_validate.c b/man_validate.c
index 822c64d2..914f63ee 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -114,6 +114,8 @@ static const struct man_valid man_valids[MAN_MAX] = {
{ NULL, NULL }, /* in */
{ NULL, posts_ft }, /* ft */
{ NULL, posts_eq2 }, /* OP */
+ { NULL, posts_nf }, /* EX */
+ { NULL, posts_fi }, /* EE */
};