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 o77HWQ1K007694 for ; Sat, 7 Aug 2010 13:32:27 -0400 (EDT) Received: from smtp-1.sys.kth.se (localhost [127.0.0.1]) by smtp-1.sys.kth.se (Postfix) with ESMTP id A24F7156FAF for ; Sat, 7 Aug 2010 19:32:20 +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 S3MNRWzvUsKA for ; Sat, 7 Aug 2010 19:32:08 +0200 (CEST) X-KTH-Auth: kristaps [85.8.61.60] X-KTH-mail-from: kristaps@bsd.lv X-KTH-rcpt-to: discuss@mdocml.bsd.lv Received: from lappy.bsd.lv (h85-8-61-60.dynamic.se.alltele.net [85.8.61.60]) by smtp-1.sys.kth.se (Postfix) with ESMTP id 328621558ED for ; Sat, 7 Aug 2010 19:32:07 +0200 (CEST) Message-ID: <4C5D9896.4010407@bsd.lv> Date: Sat, 07 Aug 2010 19:32:06 +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 Subject: Re: -column issue References: <20100806070614.GD2107@bramka.kerhand.co.uk> <4C5C417B.4050209@bsd.lv> <20100806175200.GB946@bramka.kerhand.co.uk> <20100807155941.GG23289@iris.usta.de> In-Reply-To: <20100807155941.GG23289@iris.usta.de> Content-Type: multipart/mixed; boundary="------------010003060300010209060102" This is a multi-part message in MIME format. --------------010003060300010209060102 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > 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 Ingo, Does the enclosed patch solve this behaviour? I've enclosed a handy test as well. Kristaps --------------010003060300010209060102 Content-Type: text/plain; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.txt" ? .foo.1.swp ? config.h ? config.log ? foo.1 ? foo.1.html ? foo.1.pdf ? foo.1.ps ? foo.3 ? foo.pdf ? mandoc ? mdoc.7.ps.gz ? patch.txt ? regress/mandoc.core ? regress/output Index: TODO =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/TODO,v retrieving revision 1.35 diff -u -r1.35 TODO --- TODO 27 Jul 2010 08:46:30 -0000 1.35 +++ TODO 7 Aug 2010 17:30:07 -0000 @@ -63,6 +63,9 @@ - prohibit `Nm' from having non-text HEAD children (e.g., NetBSD mDNSShared/dns-sd.1) (mdoc_html.c and mdoc_term.c `Nm' handlers can be slightly simplified) + +- allow `Qq', `Dq', `Sq', `Aq', `Bq' to have 0 arguments + noted by Alex Kozlov 08/06/10 23:05 ************************************************************************ * formatting issues: ugly output Index: mdoc.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.c,v retrieving revision 1.159 diff -u -r1.159 mdoc.c --- mdoc.c 18 Jul 2010 17:00:26 -0000 1.159 +++ mdoc.c 7 Aug 2010 17:30:07 -0000 @@ -764,11 +764,11 @@ i = offs; - /* Accept whitespace after the initial control char. */ + /* Accept tabs/whitespace after the initial control char. */ - if (' ' == buf[i]) { + if (' ' == buf[i] || '\t' == buf[i]) { i++; - while (buf[i] && ' ' == buf[i]) + while (buf[i] && (' ' == buf[i] || '\t' == buf[i])) i++; if ('\0' == buf[i]) return(1); @@ -776,15 +776,19 @@ sv = i; - /* Copy the first word into a nil-terminated buffer. */ + /* + * Copy the first word into a nil-terminated buffer. Stop + * copying when a tab, space, or eoln is encountered. + */ for (j = 0; j < 4; j++, i++) { if ('\0' == (mac[j] = buf[i])) break; - else if (' ' == buf[i]) + else if (' ' == buf[i] || '\t' == buf[i]) break; /* Check for invalid characters. */ + /* TODO: remove me, already done in main.c. */ if (isgraph((u_char)buf[i])) continue; @@ -807,7 +811,12 @@ return(1); } - /* The macro is sane. Jump to the next word. */ + /* Disregard the first trailing tab, if applicable. */ + + if ('\t' == buf[i]) + i++; + + /* Jump to the next non-whitespace word. */ while (buf[i] && ' ' == buf[i]) i++; --------------010003060300010209060102 Content-Type: text/plain; name="foo.1" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="foo.1" LkRkICRNZG9jZGF0ZSQKLkR0IEZPTyAxCi5PcwouU2ggTkFNRQouTm0gZm9vCi5OZCBiYXIK LlNoIFNZTk9QU0lTCi5JbiBoZWFkZXIuaAouVnQgZXh0ZXJuIGNvbnN0IGNoYXIgKmdsb2Jh bDsKLkZ0ICJjaGFyICoiCi5GbiBmb28gImNvbnN0IGNoYXIgKnNyYyIKLkZ0ICJjaGFyICoi Ci5GbiBiYXIgImNvbnN0IGNoYXIgKnNyYyIKLlNoIERFU0NSSVBUSU9OCi4JDQlGbCBGbAou UHAKLgkgCUZsIEZsCi5QcAouCUZsIEZsCi5QcAouRmwJCUZsCi5QcAouRmwJRmwKLlBwCi5G bCBGbAouUHAKLkZsCSBGbAouUHAKLkZsIAlGbAouUHAKLkZsCSAJRmwKLlBwCi5PcCBGbAlG bAo= --------------010003060300010209060102-- -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv