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 o77FxhNH022304 for ; Sat, 7 Aug 2010 11:59:45 -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 1OhloD-0000Va-Ma; Sat, 07 Aug 2010 17:59:41 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.71) (envelope-from ) id 1OhloD-0004qv-Lm for discuss@mdocml.bsd.lv; Sat, 07 Aug 2010 17:59:41 +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 1OhloD-0007BG-KI for discuss@mdocml.bsd.lv; Sat, 07 Aug 2010 17:59:41 +0200 Received: from schwarze by usta.de with local (Exim 4.71) (envelope-from ) id 1OhloD-0002cH-9p for discuss@mdocml.bsd.lv; Sat, 07 Aug 2010 17:59:41 +0200 Date: Sat, 7 Aug 2010 17:59:41 +0200 From: Ingo Schwarze To: discuss@mdocml.bsd.lv Subject: Re: -column issue Message-ID: <20100807155941.GG23289@iris.usta.de> References: <20100806070614.GD2107@bramka.kerhand.co.uk> <4C5C417B.4050209@bsd.lv> <20100806175200.GB946@bramka.kerhand.co.uk> X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100806175200.GB946@bramka.kerhand.co.uk> User-Agent: Mutt/1.5.20 (2009-06-14) Hi Jason and Kristaps, Jason McIntyre wrote on Fri, Aug 06, 2010 at 06:51:36PM +0059: > On Fri, Aug 06, 2010 at 07:08:11PM +0200, Kristaps Dzonsons wrote: >> Jason wrote: >>> hi. there's a formatting issue for -column lists. the best example >>> i can find is in openbsd's sysctl.3 (it's riddled with these): >>> >>> .Bl -column "Second level nameXXXXXX" integerXXX -offset indent >>> .It Sy Second level name Type Changeable >>> .It Dv FS_POSIX_SETUID No " integer yes" >>> .El >> UGH. This is gross. Why why why didn't they do: >> >> 46 .Bl -column "Second level nameXXXXXX" integerXXX -offset indent >> 47 .It Sy Second level name Type Changeable >> 48 .It Dv FS_POSIX_SETUID No integer yes >> >> (With tabs between columns.) It renders just fine in both mandoc >> and new/old groff. [...] > anyway, are you sure that your solution is correct? > look carefully at how groff formats it: > > Second level name Type Changeable > FS_POSIX_SETUID No integer yes > > i.e. it does not parse "No". mandoc does not display the "No". > same if i move the "No" into the next column > (which seems more logical). I guess now i understand. This has nothing to do with .Bl -column. Rather, we are talking about tab characters. The rules are: 1. Either a space or a tab delimit the initial macro on a line. If the delimiter is a tab, that tab is lost. Examples: .FlFl -> Fl() Fl() -> "--" .FlFl -> Fl() Fl() -> "--" .FlFl -> Fl() Fl() -> "--" In this respect, there is a bug in mandoc. A tab character does not delimit the initial macro on a line, but .Fl gives you: ERROR: bad character <-- that's the tab ERROR: unknown macro will be lost: unknown macro: Fl 2. Inside a macro line, from the point of view of the *parser*, the tab is a normal character and doesn't delimit anything. In the parser, it is preserved verbatim. Later on, the formatter will expand it. Examples: .FlFl -> Fl("Fl") -> "- Fl" .FlFl -> Fl("") Fl() -> "- -" .OpFlFl -> Op("FlFl") -> "[Fl Fl]" In this respect, mandoc actually seems to be correct. Thus, .ItDvFS_POSIX_SETUIDNointegeryes -> It(Dv(FS_POSIX_SETUID) "Nointegeryes") -> "FS_POSIX_SETUID No integer yes" In the line .It Dv FS_POSIX_SETUID No " integer yes" the space after the No is vital, whereas the quotes are not. I guess the quotes were only put to make it plain that there is a syntactically significant space preceding the tab. Oh, and the reason why .ItDvFS_POSIX_SETUIDNointegeryes cannot work is now plain too: It gives It(Dv("FS_POSIX_SETUIDNo") "integeryes") -> "FS_POSIX_SETUID No integer yes" On the other hand, you cannot put a space after the tab because it will mess up the alignment of the second column. Hence the need to put the formatting macro for the second column before the tab, and hence the idiom: macro, space, quote, tab. Enjoy roff, Ingo What remains is the quoted spacing issue in mandoc: .Bl -column "Second level nameXXXXXX" integerXXX -offset indent .It Sy Second level name Type Changeable .It Dv FS_POSIX_SETUID No integer yes .It Dv FS_POSIX_SETUID No " integer yes" .El gives Second level name Type Changeable FS_POSIX_SETUID integer yes FS_POSIX_SETUID integer yes with groff (both old and new) but Second level name Type Changeable FS_POSIX_SETUID integer yes FS_POSIX_SETUID integer yes with mandoc. -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv