From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id p0PFHJlr013974 for ; Tue, 25 Jan 2011 10:17:19 -0500 (EST) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id p0PFHIGj004363; Tue, 25 Jan 2011 10:17:18 -0500 (EST) Date: Tue, 25 Jan 2011 10:17:18 -0500 (EST) Message-Id: <201101251517.p0PFHIGj004363@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Have `Bx' accept two arguments, not just one, and join these X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Have `Bx' accept two arguments, not just one, and join these arguments with "xxBSD-yy" Modified Files: -------------- mdocml: TODO mdoc_html.c mdoc_macro.c mdoc_term.c Revision Data ------------- Index: TODO =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/TODO,v retrieving revision 1.84 retrieving revision 1.85 diff -LTODO -LTODO -u -p -r1.84 -r1.85 --- TODO +++ TODO @@ -228,12 +228,6 @@ - The space character joining .Dx .Fx .Nx .Ox (are these all?) to its argument is non-breaking. See the cdio(1) HISTORY and many others. -- .Bx uses a dash before its argument, not a space, - see for example the chpass(1) and column(1) HISTORY. - Besides, the second argument is capitalized, for example, - .Bx 4.3 tahoe . - produces 4.3BSD-Tahoe. - - In .Bl -tag, if a tag exceeds the right margin and must be continued on the next line, it must be indented by -width, not width+1; see "rule block|pass" in OpenBSD ifconfig(8). Index: mdoc_macro.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_macro.c,v retrieving revision 1.100 retrieving revision 1.101 diff -Lmdoc_macro.c -Lmdoc_macro.c -u -p -r1.100 -r1.101 --- mdoc_macro.c +++ mdoc_macro.c @@ -1461,6 +1461,8 @@ in_line_argn(MACRO_PROT_ARGS) case (MDOC_Ux): maxargs = 0; break; + case (MDOC_Bx): + /* FALLTHROUGH */ case (MDOC_Xr): maxargs = 2; break; Index: mdoc_html.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v retrieving revision 1.144 retrieving revision 1.145 diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.144 -r1.145 --- mdoc_html.c +++ mdoc_html.c @@ -832,19 +832,27 @@ mdoc_xx_pre(MDOC_ARGS) static int mdoc_bx_pre(MDOC_ARGS) { - const struct mdoc_node *nn; - struct htmlpair tag; + struct htmlpair tag; PAIR_CLASS_INIT(&tag, "unix"); print_otag(h, TAG_SPAN, 1, &tag); - for (nn = n->child; nn; nn = nn->next) - print_mdoc_node(m, nn, h); + if (NULL != (n = n->child)) { + print_text(h, n->string); + h->flags |= HTML_NOSPACE; + print_text(h, "BSD"); + } else { + print_text(h, "BSD"); + return(0); + } - if (n->child) + if (NULL != (n = n->next)) { + h->flags |= HTML_NOSPACE; + print_text(h, "-"); h->flags |= HTML_NOSPACE; + print_text(h, n->string); + } - print_text(h, "BSD"); return(0); } Index: mdoc_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v retrieving revision 1.210 retrieving revision 1.211 diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.210 -r1.211 --- mdoc_term.c +++ mdoc_term.c @@ -73,7 +73,6 @@ static void termp_an_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_bx_post(DECL_ARGS); static void termp_d1_post(DECL_ARGS); static void termp_fo_post(DECL_ARGS); static void termp_in_post(DECL_ARGS); @@ -95,6 +94,7 @@ static int termp_bk_pre(DECL_ARGS); static int termp_bl_pre(DECL_ARGS); static int termp_bold_pre(DECL_ARGS); static int termp_bt_pre(DECL_ARGS); +static int termp_bx_pre(DECL_ARGS); static int termp_cd_pre(DECL_ARGS); static int termp_d1_pre(DECL_ARGS); static int termp_ex_pre(DECL_ARGS); @@ -187,7 +187,7 @@ static const struct termact termacts[MDO { termp_quote_pre, termp_quote_post }, /* Bo */ { termp_quote_pre, termp_quote_post }, /* Bq */ { termp_xx_pre, NULL }, /* Bsx */ - { NULL, termp_bx_post }, /* Bx */ + { termp_bx_pre, NULL }, /* Bx */ { NULL, NULL }, /* Db */ { NULL, NULL }, /* Dc */ { termp_quote_pre, termp_quote_post }, /* Do */ @@ -1674,13 +1674,27 @@ termp_bd_post(DECL_ARGS) /* ARGSUSED */ -static void -termp_bx_post(DECL_ARGS) +static int +termp_bx_pre(DECL_ARGS) { - if (n->child) + if (NULL != (n = n->child)) { + term_word(p, n->string); p->flags |= TERMP_NOSPACE; - term_word(p, "BSD"); + term_word(p, "BSD"); + } else { + term_word(p, "BSD"); + return(0); + } + + if (NULL != (n = n->next)) { + p->flags |= TERMP_NOSPACE; + term_word(p, "-"); + p->flags |= TERMP_NOSPACE; + term_word(p, n->string); + } + + return(0); } -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv