=================================================================== RCS file: /cvs/mandoc/term.c,v retrieving revision 1.55 retrieving revision 1.60 diff -u -p -r1.55 -r1.60 --- mandoc/term.c 2009/03/12 06:32:17 1.55 +++ mandoc/term.c 2009/03/16 22:19:19 1.60 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.55 2009/03/12 06:32:17 kristaps Exp $ */ +/* $Id: term.c,v 1.60 2009/03/16 22:19:19 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -67,28 +67,28 @@ /* TODO: abstract this into mdocterm.c. */ const int ttypes[TTYPE_NMAX] = { - TERMP_BOLD, /* TTYPE_PROG */ + TERMP_BOLD, /* TTYPE_PROG */ TERMP_BOLD, /* TTYPE_CMD_FLAG */ - TERMP_UNDERLINE, /* TTYPE_CMD_ARG */ + TERMP_UNDER, /* TTYPE_CMD_ARG */ TERMP_BOLD, /* TTYPE_SECTION */ TERMP_BOLD, /* TTYPE_FUNC_DECL */ - TERMP_UNDERLINE, /* TTYPE_VAR_DECL */ - TERMP_UNDERLINE, /* TTYPE_FUNC_TYPE */ + TERMP_UNDER, /* TTYPE_VAR_DECL */ + TERMP_UNDER, /* TTYPE_FUNC_TYPE */ TERMP_BOLD, /* TTYPE_FUNC_NAME */ - TERMP_UNDERLINE, /* TTYPE_FUNC_ARG */ - TERMP_UNDERLINE, /* TTYPE_LINK */ + TERMP_UNDER, /* TTYPE_FUNC_ARG */ + TERMP_UNDER, /* TTYPE_LINK */ TERMP_BOLD, /* TTYPE_SSECTION */ - TERMP_UNDERLINE, /* TTYPE_FILE */ - TERMP_UNDERLINE, /* TTYPE_EMPH */ + TERMP_UNDER, /* TTYPE_FILE */ + TERMP_UNDER, /* TTYPE_EMPH */ TERMP_BOLD, /* TTYPE_CONFIG */ TERMP_BOLD, /* TTYPE_CMD */ TERMP_BOLD, /* TTYPE_INCLUDE */ TERMP_BOLD, /* TTYPE_SYMB */ TERMP_BOLD, /* TTYPE_SYMBOL */ TERMP_BOLD, /* TTYPE_DIAG */ - TERMP_UNDERLINE, /* TTYPE_LINK_ANCHOR */ + TERMP_UNDER, /* TTYPE_LINK_ANCHOR */ TERMP_BOLD, /* TTYPE_LINK_TEXT */ - TERMP_UNDERLINE /* TTYPE_REF_TITLE */ + TERMP_UNDER /* TTYPE_REF_TITLE */ }; static int arg_hasattr(int, const struct mdoc_node *); @@ -295,6 +295,9 @@ const struct termact __termacts[MDOC_MAX] = { { termp_brq_pre, termp_brq_post }, /* Brq */ { termp_brq_pre, termp_brq_post }, /* Bro */ { NULL, NULL }, /* Brc */ + { NULL, NULL }, /* %C */ + { NULL, NULL }, /* Es */ + { NULL, NULL }, /* En */ }; const struct termact *termacts = __termacts; @@ -508,6 +511,8 @@ termp_it_pre(DECL_ARGS) (&bl->args->argv[vals[2]], i); assert(i < (int)bl->args->argv[vals[2]].sz); width = arg_width(&bl->args->argv[vals[2]], i); + if (vals[1] >= 0) + offset += arg_offset(&bl->args->argv[vals[1]]); break; default: if (vals[0] >= 0) @@ -836,6 +841,7 @@ termp_rv_pre(DECL_ARGS) p->flags |= ttypes[TTYPE_FUNC_NAME]; word(p, *node->args->argv[i].value); p->flags &= ~ttypes[TTYPE_FUNC_NAME]; + p->flags |= TERMP_NOSPACE; word(p, "() function returns the value 0 if successful;"); word(p, "otherwise the value -1 is returned and the"); @@ -1465,8 +1471,12 @@ termp_ss_pre(DECL_ARGS) { switch (node->type) { + case (MDOC_BLOCK): + newln(p); + if (node->prev) + vspace(p); + break; case (MDOC_HEAD): - vspace(p); TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_SSECTION]); p->offset = INDENT / 2; break;