? .mdoc.3.swp ? config.h ? config.log ? foo.1 ? foo.1.html ? foo.3 ? foo.7 ? foo.html ? mandoc ? patch.txt ? relayd.8 ? relayd.8.html ? spamd.8 ? ssh.1 ? ssh.1.html ? regress/output Index: mdoc_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v retrieving revision 1.169 diff -u -r1.169 mdoc_term.c --- mdoc_term.c 3 Jul 2010 17:17:15 -0000 1.169 +++ mdoc_term.c 3 Jul 2010 17:25:45 -0000 @@ -72,14 +72,13 @@ static void termp_an_post(DECL_ARGS); static void termp_aq_post(DECL_ARGS); static void termp_bd_post(DECL_ARGS); -static void termp_bk_post(DECL_ARGS); static void termp_bl_post(DECL_ARGS); static void termp_bq_post(DECL_ARGS); static void termp_brq_post(DECL_ARGS); static void termp_bx_post(DECL_ARGS); static void termp_d1_post(DECL_ARGS); static void termp_dq_post(DECL_ARGS); -static int termp_fd_pre(DECL_ARGS); +static void termp_fa_post(DECL_ARGS); static void termp_fo_post(DECL_ARGS); static void termp_in_post(DECL_ARGS); static void termp_it_post(DECL_ARGS); @@ -98,7 +97,6 @@ static int termp_aq_pre(DECL_ARGS); static int termp_bd_pre(DECL_ARGS); static int termp_bf_pre(DECL_ARGS); -static int termp_bk_pre(DECL_ARGS); static int termp_bl_pre(DECL_ARGS); static int termp_bold_pre(DECL_ARGS); static int termp_bq_pre(DECL_ARGS); @@ -109,6 +107,7 @@ static int termp_dq_pre(DECL_ARGS); static int termp_ex_pre(DECL_ARGS); static int termp_fa_pre(DECL_ARGS); +static int termp_fd_pre(DECL_ARGS); static int termp_fl_pre(DECL_ARGS); static int termp_fn_pre(DECL_ARGS); static int termp_fo_pre(DECL_ARGS); @@ -161,10 +160,10 @@ { NULL, NULL }, /* Er */ { NULL, NULL }, /* Ev */ { termp_ex_pre, NULL }, /* Ex */ - { termp_fa_pre, NULL }, /* Fa */ + { termp_fa_pre, termp_fa_post }, /* Fa */ { termp_fd_pre, NULL }, /* Fd */ { termp_fl_pre, NULL }, /* Fl */ - { termp_fn_pre, NULL }, /* Fn */ + { termp_fn_pre, termp_fa_post }, /* Fn */ { termp_ft_pre, NULL }, /* Ft */ { termp_bold_pre, NULL }, /* Ic */ { termp_in_pre, termp_in_post }, /* In */ @@ -238,7 +237,7 @@ { NULL, NULL }, /* Fc */ { termp_op_pre, termp_op_post }, /* Oo */ { NULL, NULL }, /* Oc */ - { termp_bk_pre, termp_bk_post }, /* Bk */ + { NULL, NULL }, /* Bk */ { NULL, NULL }, /* Ek */ { termp_bt_pre, NULL }, /* Bt */ { NULL, NULL }, /* Hf */ @@ -1279,6 +1278,8 @@ if (MDOC_BODY != n->type) return; + if (MDOC_SYNPRETTY & n->flags) + p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); p->flags |= TERMP_NOSPACE; term_word(p, "\\(rB"); } @@ -1460,6 +1461,8 @@ case (MDOC_BODY): term_word(p, "\\(lB"); p->flags |= TERMP_NOSPACE; + if (MDOC_SYNPRETTY & n->flags) + p->flags |= TERMP_PREKEEP; break; default: break; @@ -1578,7 +1581,13 @@ for (nn = n->child->next; nn; nn = nn->next) { term_fontpush(p, TERMFONT_UNDER); + + if (MDOC_SYNPRETTY & n->flags) + p->flags |= TERMP_PREKEEP; term_word(p, nn->string); + if (MDOC_SYNPRETTY & n->flags) + p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); + term_fontpop(p); if (nn->next) @@ -1602,12 +1611,20 @@ if (n->parent->tok != MDOC_Fo) { term_fontpush(p, TERMFONT_UNDER); + if (MDOC_SYNPRETTY & n->flags) + p->flags |= TERMP_PREKEEP; return(1); } for (nn = n->child; nn; nn = nn->next) { term_fontpush(p, TERMFONT_UNDER); + + if (MDOC_SYNPRETTY & n->flags) + p->flags |= TERMP_PREKEEP; term_word(p, nn->string); + if (MDOC_SYNPRETTY & n->flags) + p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); + term_fontpop(p); if (nn->next) @@ -1622,6 +1639,16 @@ /* ARGSUSED */ +static void +termp_fa_post(DECL_ARGS) +{ + + if (MDOC_SYNPRETTY & n->flags) + p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); +} + + +/* ARGSUSED */ static int termp_bd_pre(DECL_ARGS) { @@ -2140,37 +2167,6 @@ return(0); } - -/* ARGSUSED */ -static int -termp_bk_pre(DECL_ARGS) -{ - - switch (n->type) { - case (MDOC_BLOCK): - break; - case (MDOC_HEAD): - return(0); - case (MDOC_BODY): - p->flags |= TERMP_PREKEEP; - break; - default: - abort(); - /* NOTREACHED */ - } - - return(1); -} - - -/* ARGSUSED */ -static void -termp_bk_post(DECL_ARGS) -{ - - if (MDOC_BODY == n->type) - p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); -} /* ARGSUSED */ static int Index: term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term.c,v retrieving revision 1.158 diff -u -r1.158 term.c --- term.c 3 Jul 2010 16:02:12 -0000 1.158 +++ term.c 3 Jul 2010 17:25:45 -0000 @@ -624,7 +624,11 @@ for (i = 0; i < (int)sz; i++) { if ( ! isgraph((u_char)word[i])) { - bufferc(p, word[i]); + if (TERMP_KEEP & p->flags && ' ' == word[i]) + bufferc(p, ASCII_NBRSP); + else + bufferc(p, word[i]); + continue; }