=================================================================== RCS file: /cvs/mandoc/man_macro.c,v retrieving revision 1.39 retrieving revision 1.43 diff -u -p -r1.39 -r1.43 --- mandoc/man_macro.c 2010/03/27 10:13:16 1.39 +++ mandoc/man_macro.c 2010/05/15 20:51:40 1.43 @@ -1,4 +1,4 @@ -/* $Id: man_macro.c,v 1.39 2010/03/27 10:13:16 kristaps Exp $ */ +/* $Id: man_macro.c,v 1.43 2010/05/15 20:51:40 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -28,7 +28,7 @@ enum rew { REW_REWIND, REW_NOHALT, - REW_HALT, + REW_HALT }; static int blk_close(MACRO_PROT_ARGS); @@ -86,7 +86,6 @@ const struct man_macro __man_macros[MAN_MAX] = { { blk_exp, MAN_EXPLICIT | MAN_NOCLOSE}, /* dei */ { blk_exp, MAN_EXPLICIT | MAN_NOCLOSE}, /* am */ { blk_exp, MAN_EXPLICIT | MAN_NOCLOSE}, /* ami */ - { blk_exp, MAN_EXPLICIT | MAN_NOCLOSE}, /* ig */ { blk_dotted, 0 }, /* . */ }; @@ -297,8 +296,7 @@ blk_dotted(MACRO_PROT_ARGS) for (nn = m->last->parent; nn; nn = nn->parent) if (nn->tok == MAN_de || nn->tok == MAN_dei || nn->tok == MAN_am || - nn->tok == MAN_ami || - nn->tok == MAN_ig) { + nn->tok == MAN_ami) { ntok = nn->tok; break; } @@ -314,20 +312,14 @@ blk_dotted(MACRO_PROT_ARGS) if ( ! rew_scope(MAN_BLOCK, m, ntok)) return(0); - /* - * XXX: manually adjust our next-line status. roff macros are, - * for the moment, ignored, so we don't want to close out bodies - * and so on. + /* + * Restore flags set when we got here and also stipulate that we + * don't post-process the line when exiting the macro op + * function in man_pmacro(). See blk_exp(). */ - switch (m->last->type) { - case (MAN_BODY): - m->next = MAN_NEXT_CHILD; - break; - default: - break; - } - + m->flags = m->svflags | MAN_ILINE; + m->next = m->svnext; return(1); } @@ -385,6 +377,17 @@ blk_exp(MACRO_PROT_ARGS) return(0); if ( ! rew_scope(MAN_BLOCK, m, tok)) return(0); + } else { + /* + * Save our state and next-scope indicator; we restore + * it when exiting from the roff instruction block. See + * blk_dotted(). + */ + m->svflags = m->flags; + m->svnext = m->next; + + /* Make sure we drop any line modes. */ + m->flags = 0; } if ( ! man_block_alloc(m, line, ppos, tok))