From owner-freebsd-doc@FreeBSD.ORG Wed Mar 19 23:09:40 2014 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60C8A210; Wed, 19 Mar 2014 23:09:40 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 2236CB75; Wed, 19 Mar 2014 23:09:39 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 68288D43730; Thu, 20 Mar 2014 10:09:32 +1100 (EST) Date: Thu, 20 Mar 2014 10:09:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Benjamin Kaduk Subject: Re: em dashes in mdoc (was Re: Hello fdclose) In-Reply-To: Message-ID: <20140320093525.N1015@besplex.bde.org> References: <201403181404.52197.jhb@freebsd.org> <20140319071034.H996@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PqKqMW83 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kRj94Bpp-QgA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=Ttr4Qf4ixbLBRZaoufAA:9 a=CjuIK1q_8ugA:10 Cc: freebsd-doc@freebsd.org X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 23:09:40 -0000 On Wed, 19 Mar 2014, Benjamin Kaduk wrote: > [changing cc list dramatically] > > On Wed, 19 Mar 2014, Bruce Evans wrote: > >> On Tue, 18 Mar 2014, John Baldwin wrote: >> >>> @@ -84,7 +130,9 @@ >>> .Sh NOTES >>> The >>> .Fn fclose >>> -function >>> +and >>> +.Fn fdclose >>> +functions >>> does not handle NULL arguments; they will result in a segmentation >>> violation. >>> This is intentional - it makes it easier to make sure programs written >> >> In the old version: >> >> Em-dash seems to be handled poorly by mdoc. It seems to be necessary >> to hard code it. It shouldn't be hard coded as a hyphen. > > I seem to remember looking into mdoc's handling of em dashes a month or two > ago, and concluding that mdoc did not handle em dashes at all. That is, I > did not see any macros that attempted to render as a dash of any type, so > that the man page author is required to hard code a dash as either one or two > (or three, I suppose) hyphens. > > A scan of the prior art suggested that most existing instances use a single > hyphen, and the double hyphen is quite rare. I thought the double hyphen was used more. A single hyphen is especially bad for em-dash in C and math ASCII text since it normally means a minus sign. > Warren did note that it is probably best to write in a style that avoids the > need for the em dash, which I cannot really argue against. > > Bruce, do you have any details you can add about mdoc's interaction with em > (or en) dashes? I just noticed that old gnu man pages use double dashes more, and ones that haven't been fully translated to mdoc even have a macro for it. E.g., from patch.1: %%% '\" '\" Set up \*(-- to give an unbreakable dash; '\" string Tr holds user defined translation string. '\" Bell System Logo is used as a dummy character. '\" .if !d Tr .ds Tr .ie n \{\ .tr \(*W-\*(Tr .ds -- \(*W- .if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch .if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch .ds L" "" .ds R" "" .ds L' ' .ds R' ' 'br \} .el \{\ .ds -- \(em\| .tr \*(Tr .ds L" `` .ds R" '' .ds L' ` .ds R' ' 'br\} %%% I don't understand the syntax for this. patch.1 actually uses double dashes (not em-dashes) a lot for gnu-style options. In the old version, the source code for the -c option is: .B "\-c, \-\-context" Lots of hard-coding there, in a way that disguises the double dashes (I missed this at first by grepping for "\--"). In the current version, the corresponding source code is: .It Fl c, Fl Fl context Bruce