From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-1.sys.kth.se (smtp-1.sys.kth.se [130.237.32.175]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o5RJcH6a002979 for ; Sun, 27 Jun 2010 15:38:17 -0400 (EDT) Received: from smtp-1.sys.kth.se (localhost [127.0.0.1]) by smtp-1.sys.kth.se (Postfix) with ESMTP id 339BA1571D3; Sun, 27 Jun 2010 21:38:11 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-1.sys.kth.se ([127.0.0.1]) by smtp-1.sys.kth.se (smtp-1.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dngxZ7Ly2SHL; Sun, 27 Jun 2010 21:38:00 +0200 (CEST) X-KTH-Auth: kristaps [85.8.61.244] X-KTH-mail-from: kristaps@bsd.lv Received: from lappy.bsd.lv (h85-8-61-244.dynamic.se.alltele.net [85.8.61.244]) by smtp-1.sys.kth.se (Postfix) with ESMTP id 68FB91571C9; Sun, 27 Jun 2010 21:37:58 +0200 (CEST) Message-ID: <4C27A895.5000704@bsd.lv> Date: Sun, 27 Jun 2010 21:37:57 +0200 From: Kristaps Dzonsons User-Agent: Thunderbird 2.0.0.16 (X11/20080812) X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 To: discuss@mdocml.bsd.lv CC: Jason McIntyre Subject: Re: Giant .Bk magically doing the right thing?! References: <20100627191143.GM19398@iris.usta.de> In-Reply-To: <20100627191143.GM19398@iris.usta.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > Jason just pointed me to a couple of instances of very strange .Bk > usage that seem to magically do what you want - but i have no idea > why, or how to implement this in mandoc. For example, from ifconfig(8): > > .Sh TUNNEL > .Nm ifconfig > .Bk -words > .Ar tunnel-interface > .Op Cm deletetunnel Ar src_address dest_address > .Op Cm tunnel Ar src_address dest_address > .Op Cm tunneldomain Ar route-id > .Ek > > This gives, with both old and new groff: > > TUNNEL > ifconfig tunnel-interface [deletetunnel src_address dest_address] > [tunnel src_address dest_address] [tunneldomain route-id] > > Without the .Bk, of course, groff gives: > > TUNNEL > ifconfig tunnel-interface [deletetunnel src_address dest_address] [tunnel > src_address dest_address] [tunneldomain route-id] > > Now, as far as i have understood and as i have documented in mdoc(7), > i think .Bk is supposed to keep the words in its block together. > How is groff telling the difference between the two spaces in the > string "dest_address] [tunnel src_address"? > > If the markup were > > .Sh TUNNEL > .Nm ifconfig > .Bk -words > .Ar tunnel-interface > .Op Cm deletetunnel Ar src_address dest_address > .Ek > .Bk -words > .Op Cm tunnel Ar src_address dest_address > .Ek > .Bk -words > .Op Cm tunneldomain Ar route-id > .Ek > > i would understand. But as it is, it looks like magic... If you look at NetBSD's tmac file, which is easier to read than OpenBSD's (which reliably makes my eyes bleed), you may see that `Bk' defines "hard-space", which is only invoked within parsed /words/. So in effect, hard-space is defined between words of the Op, but not between words and sub-expressions. Which macros get "words" and which macros get parsed subexpressions is entirely on a macro-by-macro basis. Note I say you "may see", because the tmacs themselves are mind-bending horrors without a single line of documentation. I mean not a SINGLE line following the license. You can always post this question to the groff mailing list. :-) Kristaps -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv