=================================================================== RCS file: /cvs/texi2mdoc/main.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -p -r1.53 -r1.54 --- texi2mdoc/main.c 2015/02/28 08:41:59 1.53 +++ texi2mdoc/main.c 2015/02/28 13:16:44 1.54 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.53 2015/02/28 08:41:59 kristaps Exp $ */ +/* $Id: main.c,v 1.54 2015/02/28 13:16:44 kristaps Exp $ */ /* * Copyright (c) 2015 Kristaps Dzonsons * @@ -498,9 +498,45 @@ dodefn(struct texi *p, enum texicmd cmd, size_t *pos) abort(); } - texivspace(p); - if (NULL != blk) - parseto(p, pos, blk); + if (NULL == blk) + return; + + /* + * All "block" definitions have their block bodies indented + * unless they have the "x" form of the command following. + * E.g., + * @deffn some function + * @deffnx another + * An explanation. + * @end deffn + * With this loop, we delay opening the indented block until we + * skipped past conformant macros. + */ + for (;;) { + switch (peekcmd(p, *pos)) { + case (TEXICMD_DEFFNX): + case (TEXICMD_DEFMACX): + case (TEXICMD_DEFTPX): + case (TEXICMD_DEFTYPEFNX): + case (TEXICMD_DEFTYPEFUNX): + case (TEXICMD_DEFTYPEMETHODX): + case (TEXICMD_DEFTYPEVARX): + case (TEXICMD_DEFTYPEVRX): + case (TEXICMD_DEFUNX): + case (TEXICMD_DEFVARX): + case (TEXICMD_DEFVRX): + texivspace(p); + parseeoln(p, pos); + continue; + default: + break; + } + break; + } + teximacro(p, "Bd -filled -offset indent"); + p->seenvs = 1; + parseto(p, pos, blk); + teximacro(p, "Ed"); } static void