Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Mar 2014 10:09:31 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Benjamin Kaduk <bjk@freebsd.org>
Cc:        freebsd-doc@freebsd.org
Subject:   Re: em dashes in mdoc (was Re: Hello fdclose)
Message-ID:  <20140320093525.N1015@besplex.bde.org>
In-Reply-To: <alpine.GSO.1.10.1403191236550.21026@multics.mit.edu>
References:  <CAGOYWV80vTTQbvSjvNa6XBzBiKy%2BjnGantkUH_RO=8prxoHmyQ@mail.gmail.com> <201403181404.52197.jhb@freebsd.org> <20140319071034.H996@besplex.bde.org> <alpine.GSO.1.10.1403191236550.21026@multics.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140320093525.N1015>