From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-2.sys.kth.se (smtp-2.sys.kth.se [130.237.32.160]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id q2RDt7gn013255 for ; Tue, 27 Mar 2012 09:55:08 -0400 (EDT) Received: from mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) by smtp-2.sys.kth.se (Postfix) with ESMTP id C751714EA27; Tue, 27 Mar 2012 15:55:01 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-2.sys.kth.se ([130.237.32.160]) by mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) (amavisd-new, port 10024) with LMTP id zBFvnE36KjUy; Tue, 27 Mar 2012 15:55:00 +0200 (CEST) X-KTH-Auth: kristaps [193.10.49.5] X-KTH-mail-from: kristaps@bsd.lv Received: from ctime.hhs.se (ctime.hhs.se [193.10.49.5]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 28CAF14F122; Tue, 27 Mar 2012 15:54:59 +0200 (CEST) Message-ID: <4F71C6B3.9080302@bsd.lv> Date: Tue, 27 Mar 2012 15:54:59 +0200 From: Kristaps Dzonsons User-Agent: Mozilla/5.0 (X11; OpenBSD amd64; rv:5.0) Gecko/20110805 Thunderbird/5.0 X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv, Joel Dahl , Jason McIntyre Subject: `Cd' and non-pairwise-breaking in SYNOPSIS. Content-Type: multipart/mixed; boundary="------------000902050805060308050403" This is a multi-part message in MIME format. --------------000902050805060308050403 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, Joel (CC'd) had asked off-list about manuals in .4 that have the following syntax: SYNOPSIS options BLAH #include #include int foo(int bar); In the mdoc(7) manpage, we specify Some macros are displayed differently in the SYNOPSIS section, particularly Nm, Cd, Fd, Fn, Fo, In, Vt, and Ft. All of these macros are output on their own line. If two such dissimilar macros are pairwise invoked (except for Ft before Fo or Fn), they are separated by a vertical space, unless in the case of Fo, Fn, and Ft, which are always separated by vertical space. But this is a lie for `Cd', which does not emit a newline as would `In' or the others. OpenBSD's manuals, for example, use a `Pp' separating the elements. Examples: http://www.openbsd.org/cgi-bin/man.cgi?query=multicast http://www.openbsd.org/cgi-bin/man.cgi?query=pim groff(1) requires the `Pp'. Basically, I think this breaks the consistency of other SYNOPSIS macros, which do not require `Pp'. In the following patch, mandoc(1) puts in the necessary space automatically. This has no effect on manuals that already use `Pp' but for a warning. I tried to patch groff's doc.tmac for the same effect, but failed. Thoughts? Kristaps --------------000902050805060308050403 Content-Type: text/plain; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch.txt" Index: mdoc_html.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v retrieving revision 1.182 diff -u -p -r1.182 mdoc_html.c --- mdoc_html.c 3 Nov 2011 20:37:00 -0000 1.182 +++ mdoc_html.c 27 Mar 2012 13:53:49 -0000 @@ -303,6 +303,8 @@ synopsis_pre(struct html *h, const struc } switch (n->prev->tok) { + case (MDOC_Cd): + /* FALLTHROUGH */ case (MDOC_Fd): /* FALLTHROUGH */ case (MDOC_Fn): Index: mdoc_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v retrieving revision 1.238 diff -u -p -r1.238 mdoc_term.c --- mdoc_term.c 13 Nov 2011 13:15:14 -0000 1.238 +++ mdoc_term.c 27 Mar 2012 13:53:50 -0000 @@ -1345,6 +1345,8 @@ synopsis_pre(struct termp *p, const stru * vertical space, else only newline and move on. */ switch (n->prev->tok) { + case (MDOC_Cd): + /* FALLTHROUGH */ case (MDOC_Fd): /* FALLTHROUGH */ case (MDOC_Fn): --------------000902050805060308050403-- -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv