=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_man.c,v retrieving revision 1.17 retrieving revision 1.18 diff -c -r1.17 -r1.18 *** src/usr.bin/mandoc/mdoc_man.c 2012/07/08 13:56:27 1.17 --- src/usr.bin/mandoc/mdoc_man.c 2012/07/08 15:00:43 1.18 *************** *** 1,4 **** ! /* $Id: mdoc_man.c,v 1.17 2012/07/08 13:56:27 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Ingo Schwarze * --- 1,4 ---- ! /* $Id: mdoc_man.c,v 1.18 2012/07/08 15:00:43 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Ingo Schwarze * *************** *** 25,40 **** #include "main.h" #define DECL_ARGS const struct mdoc_meta *m, \ ! const struct mdoc_node *n, \ ! struct mman *mm - struct mman { - int mode_space; /* spacing mode: 1 = on */ - int need_space; /* next word needs prior ws */ - int mode_keep; /* currently inside a keep */ - int need_nl; /* next word needs prior nl */ - }; - struct manact { int (*cond)(DECL_ARGS); /* DON'T run actions */ int (*pre)(DECL_ARGS); /* pre-node action */ --- 25,32 ---- #include "main.h" #define DECL_ARGS const struct mdoc_meta *m, \ ! const struct mdoc_node *n struct manact { int (*cond)(DECL_ARGS); /* DON'T run actions */ int (*pre)(DECL_ARGS); /* pre-node action */ *************** *** 81,88 **** static int pre_vt(DECL_ARGS); static int pre_ux(DECL_ARGS); static int pre_xr(DECL_ARGS); ! static void print_word(struct mman *, const char *); ! static void print_offs(struct mman *, const char *); static void print_node(DECL_ARGS); static const struct manact manacts[MDOC_MAX + 1] = { --- 73,80 ---- static int pre_vt(DECL_ARGS); static int pre_ux(DECL_ARGS); static int pre_xr(DECL_ARGS); ! static void print_word(const char *); ! static void print_offs(const char *); static void print_node(DECL_ARGS); static const struct manact manacts[MDOC_MAX + 1] = { *************** *** 217,234 **** { NULL, NULL, NULL, NULL, NULL }, /* ROOT */ }; static void ! print_word(struct mman *mm, const char *s) { ! if (mm->need_nl) { /* * If we need a newline, print it now and start afresh. */ putchar('\n'); ! mm->need_space = 0; ! mm->need_nl = 0; ! } else if (mm->need_space && '\0' != s[0]) /* * If we need a space, only print it before * (1) a nonzero length word; --- 209,231 ---- { NULL, NULL, NULL, NULL, NULL }, /* ROOT */ }; + static int outflags; + #define MMAN_spc (1 << 0) + #define MMAN_nl (1 << 1) + #define MMAN_Sm (1 << 2) + #define MMAN_Bk (1 << 3) + static void ! print_word(const char *s) { ! if (MMAN_nl & outflags) { /* * If we need a newline, print it now and start afresh. */ putchar('\n'); ! outflags &= ~(MMAN_nl|MMAN_spc); ! } else if (MMAN_spc & outflags && '\0' != s[0]) /* * If we need a space, only print it before * (1) a nonzero length word; *************** *** 236,242 **** * (3) if punctuation, non-terminating puncutation. */ if (NULL == strchr(".,:;)]?!", s[0]) || '\0' != s[1]) { ! if (mm->mode_keep) { putchar('\\'); putchar('~'); } else --- 233,239 ---- * (3) if punctuation, non-terminating puncutation. */ if (NULL == strchr(".,:;)]?!", s[0]) || '\0' != s[1]) { ! if (MMAN_Bk & outflags) { putchar('\\'); putchar('~'); } else *************** *** 247,254 **** * Reassign needing space if we're not following opening * punctuation. */ ! mm->need_space = mm->mode_space && ! (('(' != s[0] && '[' != s[0]) || '\0' != s[1]); for ( ; *s; s++) { switch (*s) { --- 244,254 ---- * Reassign needing space if we're not following opening * punctuation. */ ! if (MMAN_Sm & outflags && ! (('(' != s[0] && '[' != s[0]) || '\0' != s[1])) ! outflags |= MMAN_spc; ! else ! outflags &= ~MMAN_spc; for ( ; *s; s++) { switch (*s) { *************** *** 266,272 **** } static void ! print_offs(struct mman *mm, const char *v) { char buf[24]; struct roffsu su; --- 266,272 ---- } static void ! print_offs(const char *v) { char buf[24]; struct roffsu su; *************** *** 279,291 **** else if (0 == strcmp(v, "indent-two")) sz = 12; else if (a2roffsu(v, &su, SCALE_MAX)) { ! print_word(mm, v); return; } else sz = strlen(v); snprintf(buf, sizeof(buf), "%ldn", sz); ! print_word(mm, buf); } void --- 279,291 ---- else if (0 == strcmp(v, "indent-two")) sz = 12; else if (a2roffsu(v, &su, SCALE_MAX)) { ! print_word(v); return; } else sz = strlen(v); snprintf(buf, sizeof(buf), "%ldn", sz); ! print_word(buf); } void *************** *** 306,312 **** { const struct mdoc_meta *m; const struct mdoc_node *n; - struct mman mm; m = mdoc_meta(mdoc); n = mdoc_node(mdoc); --- 306,311 ---- *************** *** 314,324 **** printf(".TH \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"", m->title, m->msec, m->date, m->os, m->vol); ! memset(&mm, 0, sizeof(struct mman)); ! ! mm.mode_space = 1; ! mm.need_nl = 1; ! print_node(m, n, &mm); putchar('\n'); } --- 313,320 ---- printf(".TH \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"", m->title, m->msec, m->date, m->os, m->vol); ! outflags = MMAN_nl | MMAN_Sm; ! print_node(m, n); putchar('\n'); } *************** *** 336,342 **** prev = n->prev ? n->prev : n->parent; if (prev && prev->line < n->line && MDOC_Fo != prev->tok && MDOC_Ns != prev->tok) ! mm->need_nl = 1; act = NULL; cond = 0; --- 332,338 ---- prev = n->prev ? n->prev : n->parent; if (prev && prev->line < n->line && MDOC_Fo != prev->tok && MDOC_Ns != prev->tok) ! outflags |= MMAN_nl; act = NULL; cond = 0; *************** *** 347,367 **** * Make sure that we don't happen to start with a * control character at the start of a line. */ ! if (mm->need_nl && ('.' == *n->string || '\'' == *n->string)) { ! print_word(mm, "\\&"); ! mm->need_space = 0; } ! print_word(mm, n->string); } else { /* * Conditionally run the pre-node action handler for a * node. */ act = manacts + n->tok; ! cond = NULL == act->cond || (*act->cond)(m, n, mm); if (cond && act->pre) ! do_sub = (*act->pre)(m, n, mm); } /* --- 343,363 ---- * Make sure that we don't happen to start with a * control character at the start of a line. */ ! if (MMAN_nl & outflags && ('.' == *n->string || '\'' == *n->string)) { ! print_word("\\&"); ! outflags &= ~MMAN_spc; } ! print_word(n->string); } else { /* * Conditionally run the pre-node action handler for a * node. */ act = manacts + n->tok; ! cond = NULL == act->cond || (*act->cond)(m, n); if (cond && act->pre) ! do_sub = (*act->pre)(m, n); } /* *************** *** 371,383 **** */ if (do_sub) for (sub = n->child; sub; sub = sub->next) ! print_node(m, sub, mm); /* * Lastly, conditionally run the post-node handler. */ if (cond && act->post) ! (*act->post)(m, n, mm); } static int --- 367,379 ---- */ if (do_sub) for (sub = n->child; sub; sub = sub->next) ! print_node(m, sub); /* * Lastly, conditionally run the post-node handler. */ if (cond && act->post) ! (*act->post)(m, n); } static int *************** *** 406,413 **** prefix = manacts[n->tok].prefix; if (NULL == prefix) return(1); ! print_word(mm, prefix); ! mm->need_space = 0; return(1); } --- 402,409 ---- prefix = manacts[n->tok].prefix; if (NULL == prefix) return(1); ! print_word(prefix); ! outflags &= ~MMAN_spc; return(1); } *************** *** 422,431 **** suffix = manacts[n->tok].suffix; if (NULL == suffix) return; ! mm->need_space = 0; ! print_word(mm, suffix); if (MDOC_Fl == n->tok && 0 == n->nchild) ! mm->need_space = 0; } /* --- 418,427 ---- suffix = manacts[n->tok].suffix; if (NULL == suffix) return; ! outflags &= ~MMAN_spc; ! print_word(suffix); if (MDOC_Fl == n->tok && 0 == n->nchild) ! outflags &= ~MMAN_spc; } /* *************** *** 437,448 **** post_percent(DECL_ARGS) { ! post_enc(m, n, mm); if (n->next) ! print_word(mm, ","); else { ! print_word(mm, "."); ! mm->need_nl = 1; } } --- 433,444 ---- post_percent(DECL_ARGS) { ! post_enc(m, n); if (n->next) ! print_word(","); else { ! print_word("."); ! outflags |= MMAN_nl; } } *************** *** 455,464 **** if (MDOC_HEAD != n->type) return(1); ! mm->need_nl = 1; ! print_word(mm, manacts[n->tok].prefix); ! print_word(mm, "\""); ! mm->need_space = 0; return(1); } --- 451,460 ---- if (MDOC_HEAD != n->type) return(1); ! outflags |= MMAN_nl; ! print_word(manacts[n->tok].prefix); ! print_word("\""); ! outflags &= ~MMAN_spc; return(1); } *************** *** 471,488 **** if (MDOC_HEAD != n->type) return; ! mm->need_space = 0; ! print_word(mm, "\""); ! mm->need_nl = 1; } static int pre_ap(DECL_ARGS) { ! mm->need_space = 0; ! print_word(mm, "'"); ! mm->need_space = 0; return(0); } --- 467,484 ---- if (MDOC_HEAD != n->type) return; ! outflags &= ~MMAN_spc; ! print_word("\""); ! outflags |= MMAN_nl; } static int pre_ap(DECL_ARGS) { ! outflags &= ~MMAN_spc; ! print_word("'"); ! outflags &= ~MMAN_spc; return(0); } *************** *** 491,508 **** { if (0 == n->norm->Bd.comp) { ! mm->need_nl = 1; ! print_word(mm, ".sp"); } if (DISP_unfilled == n->norm->Bd.type || DISP_literal == n->norm->Bd.type) { ! mm->need_nl = 1; ! print_word(mm, ".nf"); } ! mm->need_nl = 1; ! print_word(mm, ".RS"); ! print_offs(mm, n->norm->Bd.offs); ! mm->need_nl = 1; return(1); } --- 487,504 ---- { if (0 == n->norm->Bd.comp) { ! outflags |= MMAN_nl; ! print_word(".sp"); } if (DISP_unfilled == n->norm->Bd.type || DISP_literal == n->norm->Bd.type) { ! outflags |= MMAN_nl; ! print_word(".nf"); } ! outflags |= MMAN_nl; ! print_word(".RS"); ! print_offs(n->norm->Bd.offs); ! outflags |= MMAN_nl; return(1); } *************** *** 510,523 **** post_bd(DECL_ARGS) { ! mm->need_nl = 1; ! print_word(mm, ".RE"); if (DISP_unfilled == n->norm->Bd.type || DISP_literal == n->norm->Bd.type) { ! mm->need_nl = 1; ! print_word(mm, ".fi"); } ! mm->need_nl = 1; } static int --- 506,519 ---- post_bd(DECL_ARGS) { ! outflags |= MMAN_nl; ! print_word(".RE"); if (DISP_unfilled == n->norm->Bd.type || DISP_literal == n->norm->Bd.type) { ! outflags |= MMAN_nl; ! print_word(".fi"); } ! outflags |= MMAN_nl; } static int *************** *** 528,534 **** case (MDOC_BLOCK): return(1); case (MDOC_BODY): ! mm->mode_keep = 1; return(1); default: return(0); --- 524,530 ---- case (MDOC_BLOCK): return(1); case (MDOC_BODY): ! outflags |= MMAN_Bk; return(1); default: return(0); *************** *** 540,555 **** { if (MDOC_BODY == n->type) ! mm->mode_keep = 0; } static int pre_br(DECL_ARGS) { ! mm->need_nl = 1; ! print_word(mm, ".br"); ! mm->need_nl = 1; return(0); } --- 536,551 ---- { if (MDOC_BODY == n->type) ! outflags &= ~MMAN_Bk; } static int pre_br(DECL_ARGS) { ! outflags |= MMAN_nl; ! print_word(".br"); ! outflags |= MMAN_nl; return(0); } *************** *** 559,575 **** n = n->child; if (n) { ! print_word(mm, n->string); ! mm->need_space = 0; n = n->next; } ! print_word(mm, "BSD"); if (NULL == n) return(0); ! mm->need_space = 0; ! print_word(mm, "-"); ! mm->need_space = 0; ! print_word(mm, n->string); return(0); } --- 555,571 ---- n = n->child; if (n) { ! print_word(n->string); ! outflags &= ~MMAN_spc; n = n->next; } ! print_word("BSD"); if (NULL == n) return(0); ! outflags &= ~MMAN_spc; ! print_word("-"); ! outflags &= ~MMAN_spc; ! print_word(n->string); return(0); } *************** *** 577,585 **** pre_dl(DECL_ARGS) { ! mm->need_nl = 1; ! print_word(mm, ".RS 6n"); ! mm->need_nl = 1; return(1); } --- 573,581 ---- pre_dl(DECL_ARGS) { ! outflags |= MMAN_nl; ! print_word(".RS 6n"); ! outflags |= MMAN_nl; return(1); } *************** *** 587,595 **** post_dl(DECL_ARGS) { ! mm->need_nl = 1; ! print_word(mm, ".RE"); ! mm->need_nl = 1; } static int --- 583,591 ---- post_dl(DECL_ARGS) { ! outflags |= MMAN_nl; ! print_word(".RE"); ! outflags |= MMAN_nl; } static int *************** *** 600,612 **** n = n->child; while (NULL != n) { ! print_word(mm, "\\fI"); ! mm->need_space = 0; ! print_node(m, n, mm); ! mm->need_space = 0; ! print_word(mm, "\\fP"); if (NULL != (n = n->next)) ! print_word(mm, ","); } return(0); } --- 596,608 ---- n = n->child; while (NULL != n) { ! print_word("\\fI"); ! outflags &= ~MMAN_spc; ! print_node(m, n); ! outflags &= ~MMAN_spc; ! print_word("\\fP"); if (NULL != (n = n->next)) ! print_word(","); } return(0); } *************** *** 616,622 **** { if (NULL != n->next && MDOC_Fa == n->next->tok) ! print_word(mm, ","); } static int --- 612,618 ---- { if (NULL != n->next && MDOC_Fa == n->next->tok) ! print_word(","); } static int *************** *** 628,656 **** return(0); if (MDOC_SYNPRETTY & n->flags) { ! mm->need_nl = 1; ! print_word(mm, ".br"); ! mm->need_nl = 1; } ! print_word(mm, "\\fB"); ! mm->need_space = 0; ! print_node(m, n, mm); ! mm->need_space = 0; ! print_word(mm, "\\fP("); ! mm->need_space = 0; ! return(pre_fa(m, n->next, mm)); } static void post_fn(DECL_ARGS) { ! print_word(mm, ")"); if (MDOC_SYNPRETTY & n->flags) { ! print_word(mm, ";"); ! mm->need_nl = 1; ! print_word(mm, ".br"); ! mm->need_nl = 1; } } --- 624,652 ---- return(0); if (MDOC_SYNPRETTY & n->flags) { ! outflags |= MMAN_nl; ! print_word(".br"); ! outflags |= MMAN_nl; } ! print_word("\\fB"); ! outflags &= ~MMAN_spc; ! print_node(m, n); ! outflags &= ~MMAN_spc; ! print_word("\\fP("); ! outflags &= ~MMAN_spc; ! return(pre_fa(m, n->next)); } static void post_fn(DECL_ARGS) { ! print_word(")"); if (MDOC_SYNPRETTY & n->flags) { ! print_word(";"); ! outflags |= MMAN_nl; ! print_word(".br"); ! outflags |= MMAN_nl; } } *************** *** 661,677 **** switch (n->type) { case (MDOC_HEAD): if (MDOC_SYNPRETTY & n->flags) { ! mm->need_nl = 1; ! print_word(mm, ".br"); ! mm->need_nl = 1; } ! print_word(mm, "\\fB"); ! mm->need_space = 0; break; case (MDOC_BODY): ! mm->need_space = 0; ! print_word(mm, "("); ! mm->need_space = 0; break; default: break; --- 657,673 ---- switch (n->type) { case (MDOC_HEAD): if (MDOC_SYNPRETTY & n->flags) { ! outflags |= MMAN_nl; ! print_word(".br"); ! outflags |= MMAN_nl; } ! print_word("\\fB"); ! outflags &= ~MMAN_spc; break; case (MDOC_BODY): ! outflags &= ~MMAN_spc; ! print_word("("); ! outflags &= ~MMAN_spc; break; default: break; *************** *** 685,695 **** switch (n->type) { case (MDOC_HEAD): ! mm->need_space = 0; ! print_word(mm, "\\fP"); break; case (MDOC_BODY): ! post_fn(m, n, mm); break; default: break; --- 681,691 ---- switch (n->type) { case (MDOC_HEAD): ! outflags &= ~MMAN_spc; ! print_word("\\fP"); break; case (MDOC_BODY): ! post_fn(m, n); break; default: break; *************** *** 701,713 **** { if (MDOC_SYNPRETTY & n->flags) { ! mm->need_nl = 1; ! print_word(mm, ".br"); ! mm->need_nl = 1; ! print_word(mm, "\\fB#include <"); } else ! print_word(mm, "<\\fI"); ! mm->need_space = 0; return(1); } --- 697,709 ---- { if (MDOC_SYNPRETTY & n->flags) { ! outflags |= MMAN_nl; ! print_word(".br"); ! outflags |= MMAN_nl; ! print_word("\\fB#include <"); } else ! print_word("<\\fI"); ! outflags &= ~MMAN_spc; return(1); } *************** *** 715,728 **** post_in(DECL_ARGS) { ! mm->need_space = 0; if (MDOC_SYNPRETTY & n->flags) { ! print_word(mm, ">\\fP"); ! mm->need_nl = 1; ! print_word(mm, ".br"); ! mm->need_nl = 1; } else ! print_word(mm, "\\fP>"); } static int --- 711,724 ---- post_in(DECL_ARGS) { ! outflags &= ~MMAN_spc; if (MDOC_SYNPRETTY & n->flags) { ! print_word(">\\fP"); ! outflags |= MMAN_nl; ! print_word(".br"); ! outflags |= MMAN_nl; } else ! print_word("\\fP>"); } static int *************** *** 731,751 **** const struct mdoc_node *bln; if (MDOC_HEAD == n->type) { ! mm->need_nl = 1; ! print_word(mm, ".TP"); bln = n->parent->parent->prev; switch (bln->norm->Bl.type) { case (LIST_bullet): ! print_word(mm, "4n"); ! mm->need_nl = 1; ! print_word(mm, "\\fBo\\fP"); break; default: if (bln->norm->Bl.width) ! print_word(mm, bln->norm->Bl.width); break; } ! mm->need_nl = 1; } return(1); } --- 727,747 ---- const struct mdoc_node *bln; if (MDOC_HEAD == n->type) { ! outflags |= MMAN_nl; ! print_word(".TP"); bln = n->parent->parent->prev; switch (bln->norm->Bl.type) { case (LIST_bullet): ! print_word("4n"); ! outflags |= MMAN_nl; ! print_word("\\fBo\\fP"); break; default: if (bln->norm->Bl.width) ! print_word(bln->norm->Bl.width); break; } ! outflags |= MMAN_nl; } return(1); } *************** *** 755,763 **** { if (SEC_LIBRARY == n->sec) { ! mm->need_nl = 1; ! print_word(mm, ".br"); ! mm->need_nl = 1; } } --- 751,759 ---- { if (SEC_LIBRARY == n->sec) { ! outflags |= MMAN_nl; ! print_word(".br"); ! outflags |= MMAN_nl; } } *************** *** 768,781 **** if (MDOC_ELEM != n->type && MDOC_HEAD != n->type) return(1); if (MDOC_SYNPRETTY & n->flags) { ! mm->need_nl = 1; ! print_word(mm, ".br"); ! mm->need_nl = 1; } ! print_word(mm, "\\fB"); ! mm->need_space = 0; if (NULL == n->child) ! print_word(mm, m->name); return(1); } --- 764,777 ---- if (MDOC_ELEM != n->type && MDOC_HEAD != n->type) return(1); if (MDOC_SYNPRETTY & n->flags) { ! outflags |= MMAN_nl; ! print_word(".br"); ! outflags |= MMAN_nl; } ! print_word("\\fB"); ! outflags &= ~MMAN_spc; if (NULL == n->child) ! print_word(m->name); return(1); } *************** *** 785,799 **** if (MDOC_ELEM != n->type && MDOC_HEAD != n->type) return; ! mm->need_space = 0; ! print_word(mm, "\\fP"); } static int pre_ns(DECL_ARGS) { ! mm->need_space = 0; return(0); } --- 781,795 ---- if (MDOC_ELEM != n->type && MDOC_HEAD != n->type) return; ! outflags &= ~MMAN_spc; ! print_word("\\fP"); } static int pre_ns(DECL_ARGS) { ! outflags &= ~MMAN_spc; return(0); } *************** *** 801,819 **** post_pf(DECL_ARGS) { ! mm->need_space = 0; } static int pre_pp(DECL_ARGS) { ! mm->need_nl = 1; if (MDOC_It == n->parent->tok) ! print_word(mm, ".sp"); else ! print_word(mm, ".PP"); ! mm->need_nl = 1; return(MDOC_Rs == n->tok); } --- 797,815 ---- post_pf(DECL_ARGS) { ! outflags &= ~MMAN_spc; } static int pre_pp(DECL_ARGS) { ! outflags |= MMAN_nl; if (MDOC_It == n->parent->tok) ! print_word(".sp"); else ! print_word(".PP"); ! outflags |= MMAN_nl; return(MDOC_Rs == n->tok); } *************** *** 823,831 **** assert(n->child && MDOC_TEXT == n->child->type); if (0 == strcmp("on", n->child->string)) ! mm->mode_space = 1; else ! mm->mode_space = 0; return(0); } --- 819,827 ---- assert(n->child && MDOC_TEXT == n->child->type); if (0 == strcmp("on", n->child->string)) ! outflags |= MMAN_Sm; else ! outflags &= ~MMAN_Sm; return(0); } *************** *** 833,840 **** pre_sp(DECL_ARGS) { ! mm->need_nl = 1; ! print_word(mm, ".sp"); return(1); } --- 829,836 ---- pre_sp(DECL_ARGS) { ! outflags |= MMAN_nl; ! print_word(".sp"); return(1); } *************** *** 842,848 **** post_sp(DECL_ARGS) { ! mm->need_nl = 1; } static int --- 838,844 ---- post_sp(DECL_ARGS) { ! outflags |= MMAN_nl; } static int *************** *** 858,869 **** default: return(0); } ! mm->need_nl = 1; ! print_word(mm, ".br"); ! mm->need_nl = 1; } ! print_word(mm, "\\fI"); ! mm->need_space = 0; return(1); } --- 854,865 ---- default: return(0); } ! outflags |= MMAN_nl; ! print_word(".br"); ! outflags |= MMAN_nl; } ! print_word("\\fI"); ! outflags &= ~MMAN_spc; return(1); } *************** *** 874,885 **** if (MDOC_SYNPRETTY & n->flags && MDOC_BODY != n->type) return; ! mm->need_space = 0; ! print_word(mm, "\\fP"); if (MDOC_SYNPRETTY & n->flags) { ! mm->need_nl = 1; ! print_word(mm, ".br"); ! mm->need_nl = 1; } } --- 870,881 ---- if (MDOC_SYNPRETTY & n->flags && MDOC_BODY != n->type) return; ! outflags &= ~MMAN_spc; ! print_word("\\fP"); if (MDOC_SYNPRETTY & n->flags) { ! outflags |= MMAN_nl; ! print_word(".br"); ! outflags |= MMAN_nl; } } *************** *** 890,903 **** n = n->child; if (NULL == n) return(0); ! print_node(m, n, mm); n = n->next; if (NULL == n) return(0); ! mm->need_space = 0; ! print_word(mm, "("); ! print_node(m, n, mm); ! print_word(mm, ")"); return(0); } --- 886,899 ---- n = n->child; if (NULL == n) return(0); ! print_node(m, n); n = n->next; if (NULL == n) return(0); ! outflags &= ~MMAN_spc; ! print_word("("); ! print_node(m, n); ! print_word(")"); return(0); } *************** *** 905,915 **** pre_ux(DECL_ARGS) { ! print_word(mm, manacts[n->tok].prefix); if (NULL == n->child) return(0); ! mm->need_space = 0; ! print_word(mm, "\\~"); ! mm->need_space = 0; return(1); } --- 901,911 ---- pre_ux(DECL_ARGS) { ! print_word(manacts[n->tok].prefix); if (NULL == n->child) return(0); ! outflags &= ~MMAN_spc; ! print_word("\\~"); ! outflags &= ~MMAN_spc; return(1); }