From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-2.sys.kth.se (smtp-2.sys.kth.se [130.237.32.160]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o8U9LQH7029852 for ; Thu, 30 Sep 2010 05:21:27 -0400 (EDT) Received: from mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) by smtp-2.sys.kth.se (Postfix) with ESMTP id F0DB414F355; Thu, 30 Sep 2010 11:21:20 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-2.sys.kth.se ([130.237.32.160]) by mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) (amavisd-new, port 10024) with LMTP id Ll3SKsI1juBC; Thu, 30 Sep 2010 11:21:13 +0200 (CEST) X-KTH-Auth: kristaps [85.8.61.24] X-KTH-mail-from: kristaps@bsd.lv Received: from lappy.cust.alltele.se (h85-8-61-24.dynamic.se.alltele.net [85.8.61.24]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 95CBC14F354; Thu, 30 Sep 2010 11:21:11 +0200 (CEST) Message-ID: <4CA45693.10809@bsd.lv> Date: Thu, 30 Sep 2010 11:21:23 +0200 From: Kristaps Dzonsons User-Agent: Thunderbird 2.0.0.23 (X11/20100318) X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv, jmc@kerhand.co.uk Subject: [PATCH] TODO entries for `Ns' and `No' spacing. Content-Type: multipart/mixed; boundary="------------010203020102070205020906" This is a multi-part message in MIME format. --------------010203020102070205020906 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, Can anybody Ok that this patch correctly handles the cases of `No' and `Ns' with respect to spacing and without fallout? Cf. TODO items - .No text No ) is "text )", not "text)" see the terrible example case word in [[(] pattern [| pattern] ... ) list ;; ] ... esac in OpenBSD ksh(1) - .It ${name Ns [ selector ] Ns } should be "${name[selector]}" not "${name [selector]}" This is parsed as text("${name") text("[") Ns() text(selector)... Opening punctuation should not fall out of .Ns. see for example OpenBSD csh(1) Note that the ellipsis suppresses whitespace because of the trailing period. This is a new TODO. Kristaps --------------010203020102070205020906 Content-Type: text/plain; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.txt" ? .TODO.swp ? config.h ? config.log ? csh.1 ? foo.1 ? foo.1.html ? foo.3 ? gcc.1 ? ksh.1 ? mandoc ? mandoc.core ? patch.txt ? regress/output Index: mdoc_macro.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_macro.c,v retrieving revision 1.94 diff -u -r1.94 mdoc_macro.c --- mdoc_macro.c 26 Sep 2010 20:22:28 -0000 1.94 +++ mdoc_macro.c 30 Sep 2010 09:17:41 -0000 @@ -139,7 +139,7 @@ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Fx */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ms */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* No */ - { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ns */ + { in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_IGNDELIM }, /* Ns */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Nx */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ox */ { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Pc */ Index: mdoc_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v retrieving revision 1.191 diff -u -r1.191 mdoc_term.c --- mdoc_term.c 27 Sep 2010 23:03:44 -0000 1.191 +++ mdoc_term.c 30 Sep 2010 09:17:41 -0000 @@ -75,11 +75,11 @@ static void termp_bx_post(DECL_ARGS); static void termp_d1_post(DECL_ARGS); static void termp_fo_post(DECL_ARGS); +static void termp_igndelim_post(DECL_ARGS); static void termp_in_post(DECL_ARGS); static void termp_it_post(DECL_ARGS); static void termp_lb_post(DECL_ARGS); static void termp_nm_post(DECL_ARGS); -static void termp_pf_post(DECL_ARGS); static void termp_quote_post(DECL_ARGS); static void termp_sh_post(DECL_ARGS); static void termp_ss_post(DECL_ARGS); @@ -102,6 +102,7 @@ static int termp_fn_pre(DECL_ARGS); static int termp_fo_pre(DECL_ARGS); static int termp_ft_pre(DECL_ARGS); +static int termp_igndelim_pre(DECL_ARGS); static int termp_in_pre(DECL_ARGS); static int termp_it_pre(DECL_ARGS); static int termp_li_pre(DECL_ARGS); @@ -109,7 +110,6 @@ static int termp_nd_pre(DECL_ARGS); static int termp_nm_pre(DECL_ARGS); static int termp_ns_pre(DECL_ARGS); -static int termp_pf_pre(DECL_ARGS); static int termp_quote_pre(DECL_ARGS); static int termp_rs_pre(DECL_ARGS); static int termp_rv_pre(DECL_ARGS); @@ -196,12 +196,12 @@ { NULL, NULL }, /* Eo */ { termp_xx_pre, NULL }, /* Fx */ { termp_bold_pre, NULL }, /* Ms */ - { NULL, NULL }, /* No */ + { termp_igndelim_pre, termp_igndelim_post }, /* No */ { termp_ns_pre, NULL }, /* Ns */ { termp_xx_pre, NULL }, /* Nx */ { termp_xx_pre, NULL }, /* Ox */ { NULL, NULL }, /* Pc */ - { termp_pf_pre, termp_pf_post }, /* Pf */ + { termp_igndelim_pre, termp_igndelim_post }, /* Pf */ { termp_quote_pre, termp_quote_post }, /* Po */ { termp_quote_pre, termp_quote_post }, /* Pq */ { NULL, NULL }, /* Qc */ @@ -1684,7 +1684,7 @@ /* ARGSUSED */ static int -termp_pf_pre(DECL_ARGS) +termp_igndelim_pre(DECL_ARGS) { p->flags |= TERMP_IGNDELIM; @@ -1694,11 +1694,12 @@ /* ARGSUSED */ static void -termp_pf_post(DECL_ARGS) +termp_igndelim_post(DECL_ARGS) { p->flags &= ~TERMP_IGNDELIM; - p->flags |= TERMP_NOSPACE; + if (MDOC_Pf == n->tok) + p->flags |= TERMP_NOSPACE; } --------------010203020102070205020906-- -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv