From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.rz.uni-karlsruhe.de (Debian-exim@smtp1.rz.uni-karlsruhe.de [129.13.185.217]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id p16KdWsJ001483 for ; Sun, 6 Feb 2011 15:39:33 -0500 (EST) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by smtp1.rz.uni-karlsruhe.de with esmtp (Exim 4.63 #1) id 1PmBON-00089q-BG; Sun, 06 Feb 2011 21:39:31 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1PmBON-0000M1-9p for tech@mdocml.bsd.lv; Sun, 06 Feb 2011 21:39:31 +0100 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.69) (envelope-from ) id 1PmBON-0001w4-8X for tech@mdocml.bsd.lv; Sun, 06 Feb 2011 21:39:31 +0100 Received: from schwarze by usta.de with local (Exim 4.72) (envelope-from ) id 1PmBOM-0005M1-Uk for tech@mdocml.bsd.lv; Sun, 06 Feb 2011 21:39:31 +0100 Date: Sun, 6 Feb 2011 21:39:30 +0100 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: Bugs and regressions in .Bk Message-ID: <20110206203930.GH28747@iris.usta.de> References: <201101251620.p0PGKPeH004751@krisdoz.my.domain> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <201101251620.p0PGKPeH004751@krisdoz.my.domain> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Kristaps, > Log Message: > ----------- > Arguments to `Bsx' and friends are separated by a non-breaking space. > This removes a TODO raised by schwarze@. While trying to merge this patch, i ran into a regression: When called inside .Bk or in the SYNOPSIS, this patch ends keep mode. Trying to fix that (meanwhile, i have a working fix, so don't waste your time searching for it), i ran into another .Bk bug: For text generated in the pre-handler, setting up keep state comes too late to take effect. So, my plan is to 1) Get the following patch in, fixing the latter bug - OK? The code is unchanged, it is just moved around. 2) Once that's in, merge your patch to OpenBSD, together with my fix for the regression. 3) Finally, merge back my regression fix to bsd.lv. Yours, Ingo Index: usr.bin/mandoc/mdoc_term.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/usr.bin/mandoc/mdoc_term.c,v retrieving revision 1.127 diff -u -p -r1.127 mdoc_term.c --- usr.bin/mandoc/mdoc_term.c 6 Feb 2011 17:33:20 -0000 1.127 +++ usr.bin/mandoc/mdoc_term.c 6 Feb 2011 20:32:04 -0000 @@ -308,22 +308,6 @@ print_mdoc_node(DECL_ARGS) =20 memset(&npair, 0, sizeof(struct termpair)); npair.ppair =3D pair; -=09 - switch (n->type) { - case (MDOC_TEXT): - if (' ' =3D=3D *n->string && MDOC_LINE & n->flags) - term_newln(p); - term_word(p, n->string); - break; - case (MDOC_TBL): - term_tbl(p, n->span); - break; - default: - if (termacts[n->tok].pre && ENDBODY_NOT =3D=3D n->end) - chld =3D (*termacts[n->tok].pre) - (p, &npair, m, n); - break; - } =20 /* * Keeps only work until the end of a line. If a keep was @@ -354,6 +338,22 @@ print_mdoc_node(DECL_ARGS) ((n->prev && MDOC_SYNPRETTY & n->prev->flags) || (n->parent && MDOC_SYNPRETTY & n->parent->flags))) p->flags &=3D ~(TERMP_KEEP | TERMP_PREKEEP); + + switch (n->type) { + case (MDOC_TEXT): + if (' ' =3D=3D *n->string && MDOC_LINE & n->flags) + term_newln(p); + term_word(p, n->string); + break; + case (MDOC_TBL): + term_tbl(p, n->span); + break; + default: + if (termacts[n->tok].pre && ENDBODY_NOT =3D=3D n->end) + chld =3D (*termacts[n->tok].pre) + (p, &npair, m, n); + break; + } =20 if (chld && n->child) print_mdoc_nodelist(p, &npair, m, n->child); Index: regress/usr.bin/mandoc/mdoc/Bk/break.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/regress/usr.bin/mandoc/mdoc/Bk/break.in,v retrieving revision 1.1 diff -u -p -r1.1 break.in --- regress/usr.bin/mandoc/mdoc/Bk/break.in 19 Dec 2010 12:10:33 -0000 1.1 +++ regress/usr.bin/mandoc/mdoc/Bk/break.in 6 Feb 2011 20:32:04 -0000 @@ -5,6 +5,24 @@ .Nm Bk-break .Nd handling of word keeps .Sh DESCRIPTION +Even though it is called a word keep, +.Bk -words +it will not keep words together in free-form text. +.Ek +However, even the noop macro +.Bk -words +.No is sufficient to let the keep take effect . +.Ek +Even text generated in pre-handlers must be kept together with +the text following it: +.Bk -words +.Xr one 1 No and Xr two 2 +.Ek +should be on the same line. +.Pp +Including the whole output line into the keep is not required, +including just the macros to be kept together is sufficient: +.Pp .Nm .Ar x x x x x x x x .Ar x x x x x x x x Index: regress/usr.bin/mandoc/mdoc/Bk/break.out_ascii =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/regress/usr.bin/mandoc/mdoc/Bk/break.out_ascii,v retrieving revision 1.1 diff -u -p -r1.1 break.out_ascii --- regress/usr.bin/mandoc/mdoc/Bk/break.out_ascii 19 Dec 2010 12:10:33 -00= 00 1.1 +++ regress/usr.bin/mandoc/mdoc/Bk/break.out_ascii 6 Feb 2011 20:32:04 -0000 @@ -4,6 +4,15 @@ N=08NA=08AM=08ME=08E B=08Bk=08k-=08-b=08br=08re=08ea=08ak=08k - handling of word keeps =20 D=08DE=08ES=08SC=08CR=08RI=08IP=08PT=08TI=08IO=08ON=08N + Even though it is called a word keep, it will not keep words together= in + free-form text. However, even the noop macro + is sufficient to let the keep take effect. Even text generated in pr= e- + handlers must be kept together with the text following it: + one(1) and two(2) should be on the same line. + + Including the whole output line into the keep is not required, includ= ing + just the macros to be kept together is sufficient: + B=08Bk=08k-=08-b=08br=08re=08ea=08ak=08k _=08x _=08x _=08x _=08x _=08= x _=08x _=08x _=08x _=08x _=08x _=08x _=08x _=08x _=08x _=08x _=08x _=08x _= =08x _=08x _=08x _=08x _=08x _=08x _=08x _=08x _=08x _=08x _=08x _=08x _=08x [o _=08a] =20 -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv