summaryrefslogtreecommitdiffstats
path: root/mdoc_macro.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-07-02 03:48:07 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-07-02 03:48:07 +0000
commit6953ebc600f2fbc755c081f62f54e09e92399d68 (patch)
tree1e47ae2fa2358a5af6a9ee8178e35fff7d034614 /mdoc_macro.c
parent86806389168051f6ba486c442c442708d5e0fa73 (diff)
downloadmandoc-6953ebc600f2fbc755c081f62f54e09e92399d68.tar.gz
Implement the obsolete macros .En .Es .Fr .Ot for backward compatibility,
since this is hardly more complicated than explicitly ignoring them as we did in the past. Of course, do not use them!
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 47b84287..b891df79 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -48,7 +48,6 @@ static int ctx_synopsis(MACRO_PROT_ARGS);
static int in_line_eoln(MACRO_PROT_ARGS);
static int in_line_argn(MACRO_PROT_ARGS);
static int in_line(MACRO_PROT_ARGS);
-static int obsolete(MACRO_PROT_ARGS);
static int phrase_ta(MACRO_PROT_ARGS);
static int dword(struct mdoc *, int, int, const char *,
@@ -104,7 +103,7 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
{ blk_full, MDOC_JOIN }, /* Nd */
{ ctx_synopsis, MDOC_CALLABLE | MDOC_PARSED }, /* Nm */
{ blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Op */
- { obsolete, 0 }, /* Ot */
+ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ot */
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Pa */
{ in_line_eoln, 0 }, /* Rv */
{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* St */
@@ -191,7 +190,7 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
{ blk_exp_close, MDOC_EXPLICIT | MDOC_JOIN }, /* Ek */
{ in_line_eoln, 0 }, /* Bt */
{ in_line_eoln, 0 }, /* Hf */
- { obsolete, 0 }, /* Fr */
+ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fr */
{ in_line_eoln, 0 }, /* Ud */
{ in_line, 0 }, /* Lb */
{ in_line_eoln, 0 }, /* Lp */
@@ -203,8 +202,8 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
{ blk_exp_close, MDOC_CALLABLE | MDOC_PARSED |
MDOC_EXPLICIT | MDOC_JOIN }, /* Brc */
{ in_line_eoln, MDOC_JOIN }, /* %C */
- { obsolete, 0 }, /* Es */
- { obsolete, 0 }, /* En */
+ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Es */
+ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* En */
{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Dx */
{ in_line_eoln, MDOC_JOIN }, /* %Q */
{ in_line_eoln, 0 }, /* br */
@@ -1528,6 +1527,8 @@ in_line_argn(MACRO_PROT_ARGS)
break;
case MDOC_Bx:
/* FALLTHROUGH */
+ case MDOC_Es:
+ /* FALLTHROUGH */
case MDOC_Xr:
maxargs = 2;
break;
@@ -1715,14 +1716,6 @@ ctx_synopsis(MACRO_PROT_ARGS)
return(blk_part_imp(mdoc, tok, line, ppos, pos, buf));
}
-static int
-obsolete(MACRO_PROT_ARGS)
-{
-
- mdoc_pmsg(mdoc, line, ppos, MANDOCERR_MACROOBS);
- return(1);
-}
-
/*
* Phrases occur within `Bl -column' entries, separated by `Ta' or tabs.
* They're unusual because they're basically free-form text until a