From 7b965f63cfd7d1b9474221bad812a9d975b94b46 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 2 Jul 2014 03:48:07 +0000 Subject: 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! --- mdoc_macro.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'mdoc_macro.c') diff --git a/mdoc_macro.c b/mdoc_macro.c index 762f59e6..f16572d4 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.131 2014/04/20 16:46:05 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.132 2014/07/02 03:48:07 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2012, 2013 Ingo Schwarze @@ -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 -- cgit v1.2.3-56-ge451