=================================================================== RCS file: /cvs/texi2mdoc/main.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -p -r1.12 -r1.13 --- texi2mdoc/main.c 2015/02/18 23:08:16 1.12 +++ texi2mdoc/main.c 2015/02/19 07:50:51 1.13 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.12 2015/02/18 23:08:16 kristaps Exp $ */ +/* $Id: main.c,v 1.13 2015/02/19 07:50:51 kristaps Exp $ */ /* * Copyright (c) 2015 Kristaps Dzonsons * @@ -92,6 +92,7 @@ enum texicmd { TEXICMD_IFSET, TEXICMD_IMAGE, TEXICMD_INCLUDE, + TEXICMD_INDENTBLOCK, TEXICMD_INSERTCOPYING, TEXICMD_ITEM, TEXICMD_ITEMIZE, @@ -123,6 +124,7 @@ enum texicmd { TEXICMD_SPACE, TEXICMD_SMALLDISPLAY, TEXICMD_SMALLEXAMPLE, + TEXICMD_SMALLINDENTBLOCK, TEXICMD_SQUIGGLE_LEFT, TEXICMD_SQUIGGLE_RIGHT, TEXICMD_STRONG, @@ -298,6 +300,7 @@ static const struct texitok texitoks[TEXICMD__MAX] = { { doignblock, "ifset", 5 }, /* TEXICMD_IFSET */ { doignbracket, "image", 5 }, /* TEXICMD_IMAGE */ { doinclude, "include", 7 }, /* TEXICMD_INCLUDE */ + { dodisplay, "indentblock", 11 }, /* TEXICMD_INDENTBLOCK */ { doignline, "insertcopying", 13 }, /* TEXICMD_INSERTCOPYING */ { doitem, "item", 4 }, /* TEXICMD_ITEM */ { doitemize, "itemize", 7 }, /* TEXICMD_ITEMIZE */ @@ -329,6 +332,7 @@ static const struct texitok texitoks[TEXICMD__MAX] = { { dosymbol, " ", 1 }, /* TEXICMD_SPACE */ { dodisplay, "smalldisplay", 12 }, /* TEXICMD_SMALLDISPLAY */ { doexample, "smallexample", 12 }, /* TEXICMD_SMALLEXAMPLE */ + { dodisplay, "smallindentblock", 16 }, /* TEXICMD_SMALLINDENTBLOCK */ { dosymbol, "{", 1 }, /* TEXICMD_SQUIGGLE_LEFT */ { dosymbol, "}", 1 }, /* TEXICMD_SQUIGGLE_RIGHT */ { dofont, "strong", 6 }, /* TEXICMD_STRONG */ @@ -1251,11 +1255,11 @@ dodisplay(struct texi *p, enum texicmd cmd, const char *buf, size_t sz, size_t *pos) { - teximacro(p, "Bd -display -offset indent"); + teximacro(p, "Bd -filled -offset indent"); p->seenvs = 1; /* FIXME: ignore and parseeoln. */ advanceeoln(p, buf, sz, pos, 1); - parseto(p, buf, sz, pos, "display"); + parseto(p, buf, sz, pos, texitoks[cmd].tok); teximacro(p, "Ed"); } @@ -1263,15 +1267,12 @@ static void doexample(struct texi *p, enum texicmd cmd, const char *buf, size_t sz, size_t *pos) { - const char *blk; - blk = TEXICMD_EXAMPLE == cmd ? "example" : "smallexample"; - teximacro(p, "Bd -literal -offset indent"); /* FIXME: ignore and parseeoln. */ advanceeoln(p, buf, sz, pos, 1); p->literal++; - parseto(p, buf, sz, pos, blk); + parseto(p, buf, sz, pos, texitoks[cmd].tok); p->literal--; teximacro(p, "Ed"); } @@ -1459,6 +1460,11 @@ static void dosubsection(struct texi *p, enum texicmd cmd, const char *buf, size_t sz, size_t *pos) { + + if (p->outmacro) + texierr(p, "\"Em\" in open line scope!?"); + else if (p->literal) + texierr(p, "\"Em\" in a literal scope!?"); texivspace(p); teximacroopen(p, "Em");