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 o7K5n5Pf000733 for ; Fri, 20 Aug 2010 01:49:07 -0400 (EDT) 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 1OmKTM-0004ij-IE; Fri, 20 Aug 2010 07:49:00 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.71) (envelope-from ) id 1OmE7p-00052h-Bn; Fri, 20 Aug 2010 01:02:21 +0200 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.69) (envelope-from ) id 1OmE7p-0002oE-Am; Fri, 20 Aug 2010 01:02:21 +0200 Received: from schwarze by usta.de with local (Exim 4.71) (envelope-from ) id 1OmE7o-0006bd-RG; Fri, 20 Aug 2010 01:02:21 +0200 Date: Fri, 20 Aug 2010 01:02:20 +0200 From: Ingo Schwarze To: Ray Lai , jmc@openbsd.org, kristaps@bsd.lv Cc: tech@mdocml.bsd.lv Subject: Re: operator(7) differences (groff vs mandoc) Message-ID: <20100819230220.GC29289@iris.usta.de> References: 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: User-Agent: Mutt/1.5.20 (2009-06-14) Hi, Ray Lai wrote on Thu, Aug 19, 2010 at 12:49:57AM -0700: > There should be a space between the "->" and the ".". >=20 > --- - Thu Aug 19 00:45:49 2010 > +++ /usr/share/man/cat7/operator.0 Wed Aug 11 08:56:18 2010 > @@ -6,7 +6,7 @@ > D=08DE=08ES=08SC=08CR=08RI=08IP=08PT=08TI=08IO=08ON=08N > Operator Associativity > -------- ------------- > - () [] -> . left to right > + () [] ->. left to right > ! ~ ++ -- - (type) * & sizeof right to left > * / % left to right > + - left to right Ray, thank you for reporting this, it is indeed a bug in mandoc that i was not aware of. The point is that .Bl -column phrases must be rendered using TERMP_IGNDELIM, a requirement that we missed so far. The following patch closes the most glaring issue and fixes operator(7); OK to commit it for now? Beyond that, i'm adding two entries to our TODO list: - inside `.Bl -column' phrases, punctuation is handled like normal text, e.g. `.Bl -column .It Fl x . Ta ...' gives "-x -." =20 - inside `.Bl -column' phrases, TERMP_IGNDELIM handling by `Pf' is not safe, e.g. `.Bl -column .It Pf a b .' gives "ab." but should give "ab .": TERMP_IGNDELIM is reset early. Anybody noticed yet that .Bl -column is a slightly nasty? ;) Yours, Ingo Index: 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.101 diff -u -p -r1.101 mdoc_term.c --- mdoc_term.c 18 Aug 2010 01:45:22 -0000 1.101 +++ mdoc_term.c 19 Aug 2010 22:38:26 -0000 @@ -838,6 +838,8 @@ termp_it_pre(DECL_ARGS) if (MDOC_BODY =3D=3D n->prev->type)=20 p->flags |=3D TERMP_NOLPAD; =20 + p->flags |=3D TERMP_IGNDELIM; + break; case (LIST_diag): if (MDOC_HEAD =3D=3D n->type) @@ -996,6 +998,13 @@ termp_it_post(DECL_ARGS) p->flags &=3D ~TERMP_TWOSPACE; p->flags &=3D ~TERMP_NOLPAD; p->flags &=3D ~TERMP_HANG; + + /* + * TERMP_IGNDELIM is also set by `Pf', but it is safe + * to clear it here because `Pf' cannot contain `It'. + */ + + p->flags &=3D ~TERMP_IGNDELIM; } =20 =20 @@ -1800,6 +1809,10 @@ static void termp_pf_post(DECL_ARGS) { =20 + /* + * XXX Resetting TERMP_IGNDELIM here is not safe + * because `Pf' can be used inside `Bl -column'. + */ p->flags &=3D ~TERMP_IGNDELIM; p->flags |=3D TERMP_NOSPACE; } -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv