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 o7GF93JR019014 for ; Mon, 16 Aug 2010 11:09:04 -0400 (EDT) Received: from smtp-1.sys.kth.se (localhost [127.0.0.1]) by smtp-1.sys.kth.se (Postfix) with ESMTP id 27964157036 for ; Mon, 16 Aug 2010 17:08:57 +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 2yRDTFGEqHfo for ; Mon, 16 Aug 2010 17:08:55 +0200 (CEST) X-KTH-Auth: kristaps [130.237.221.96] X-KTH-mail-from: kristaps@bsd.lv X-KTH-rcpt-to: discuss@mdocml.bsd.lv Received: from [130.237.221.96] (ctime.pdc.kth.se [130.237.221.96]) by smtp-1.sys.kth.se (Postfix) with ESMTP id BE37F156F98 for ; Mon, 16 Aug 2010 17:08:54 +0200 (CEST) Message-ID: <4C695418.30206@bsd.lv> Date: Mon, 16 Aug 2010 17:07:04 +0200 From: Kristaps Dzonsons User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100329) X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 To: "discuss@mdocml.bsd.lv" Subject: roff ugliness. Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit The extent of hideous roff-isms expands. Consider this, in the standard pod2man preamble: .ds Ae A\h'-(\w'A'u*4/10)'E Notice that something's amiss. The first apostrophe in the escape "\h'" appears to be closed at "\w'", which renders this inscrutable to mandoc. But no: in fact, escapes are RECURSIVE. Thus, this resolves to \h'-( # negative value of... \('A'u # unit length * length of "A" * # multiplied by 4/10 # 4/10 )' Or in other words, a mathematical expression embedded in the macro, which in turn consists of an embedded expression. This is only a problem since `ds' was implemented. Before, I'd hard-coded the values for the pod2man preamble predefined strings. But now `ds' is correctly reading them, so the default predefines are just dead weight (see last commits for my removal of "\*(C+") (this use a non-recursive string, so it's ok). In short, looks like some more intelligence is going to be required in the roff library. Fortunately, these escapes aren't used too often. But when they are, they're going to spit out some garbage like \*(Ae -> AA'u*4/10)'E This makes sense from mandoc's perspective cause "\h" is being closed after "\w", with the rest being verbatim. A short-term solution is to mark the "standard" pod2man escapes as being non-overridable. This will at least contain the ugliness while a better evaluator is added to libroff. Kristaps -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv