Linux-man Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/3] system_data_types.7: time_t: Add Versions note
@ 2020-10-17 21:37 Alejandro Colomar
  2020-10-17 21:37 ` [PATCH 2/3] system_data_types.7: Add 'clock_t' Alejandro Colomar
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Alejandro Colomar @ 2020-10-17 21:37 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, libc-alpha

Prior to POSIX.1-2008, POSIX allowed time_t to be a real-floating type.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
---

Hi Michael,

I found this thing when writing about clock_t.

BTW, I'm not sure about the .PP before the paragraph
(it feels like "Versions" is too far away from it),
but it's unrelated to the previous Versions note, so I kept it.

Regards,

Alex


 man7/system_data_types.7 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/man7/system_data_types.7 b/man7/system_data_types.7
index 8a894b2e0..dc5f65c0d 100644
--- a/man7/system_data_types.7
+++ b/man7/system_data_types.7
@@ -1236,6 +1236,9 @@ defines
 .I time_t
 since POSIX.1-2008.
+.PP
+Prior to POSIX.1-2008,
+the type was either an integer type or a real-floating type.
 .PP
 Conforming to:
 C99 and later; POSIX.1-2001 and later.
 .PP
-- 
2.28.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 2/3] system_data_types.7: Add 'clock_t'
  2020-10-17 21:37 [PATCH 1/3] system_data_types.7: time_t: Add Versions note Alejandro Colomar
@ 2020-10-17 21:37 ` Alejandro Colomar
  2020-10-18  5:56   ` Michael Kerrisk (man-pages)
  2020-10-17 21:37 ` [PATCH 3/3] clock_t.3: New link to system_data_types(3) Alejandro Colomar
  2020-10-18  1:05 ` [PATCH 1/3] system_data_types.7: time_t: Add Versions note Paul Eggert
  2 siblings, 1 reply; 15+ messages in thread
From: Alejandro Colomar @ 2020-10-17 21:37 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, libc-alpha

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
---

Hi Michael,

Does that dash (in "real-floating") need to be escaped?

In my terminal I see it correctly,
but I've seen you escaping some of them and don't know the reason why.

Should they be escaped always, or is it only sometimes, and when?

Thanks,

Alex


 man7/system_data_types.7 | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/man7/system_data_types.7 b/man7/system_data_types.7
index dc5f65c0d..6a1442ccd 100644
--- a/man7/system_data_types.7
+++ b/man7/system_data_types.7
@@ -85,6 +85,28 @@ See also:
 .BR aio_write (3),
 .BR lio_listio (3)
 .RE
+.\"------------------------------------- clock_t ----------------------/
+.TP
+.I clock_t
+.RS
+Include:
+.I <time.h>
+or
+.IR <sys/types.h> .
+Alternatively,
+.IR <sys/time.h> .
+.PP
+Used for system time in clock ticks.
+According to POSIX,
+it shall be an integer type or a real-floating type.
+.PP
+Conforming to:
+C99 and later; POSIX.1-2001 and later.
+.PP
+See also:
+.BR times (2),
+.BR clock (3)
+.RE
 .\"------------------------------------- div_t ------------------------/
 .TP
 .I div_t
-- 
2.28.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 3/3] clock_t.3: New link to system_data_types(3)
  2020-10-17 21:37 [PATCH 1/3] system_data_types.7: time_t: Add Versions note Alejandro Colomar
  2020-10-17 21:37 ` [PATCH 2/3] system_data_types.7: Add 'clock_t' Alejandro Colomar
@ 2020-10-17 21:37 ` Alejandro Colomar
  2020-10-18 16:52   ` Michael Kerrisk (man-pages)
  2020-10-18  1:05 ` [PATCH 1/3] system_data_types.7: time_t: Add Versions note Paul Eggert
  2 siblings, 1 reply; 15+ messages in thread
From: Alejandro Colomar @ 2020-10-17 21:37 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, libc-alpha

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
---
 man3/clock_t.3 | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 man3/clock_t.3

diff --git a/man3/clock_t.3 b/man3/clock_t.3
new file mode 100644
index 000000000..db50c0f09
--- /dev/null
+++ b/man3/clock_t.3
@@ -0,0 +1 @@
+.so man7/system_data_types.7
-- 
2.28.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] system_data_types.7: time_t: Add Versions note
  2020-10-17 21:37 [PATCH 1/3] system_data_types.7: time_t: Add Versions note Alejandro Colomar
  2020-10-17 21:37 ` [PATCH 2/3] system_data_types.7: Add 'clock_t' Alejandro Colomar
  2020-10-17 21:37 ` [PATCH 3/3] clock_t.3: New link to system_data_types(3) Alejandro Colomar
@ 2020-10-18  1:05 ` Paul Eggert
  2020-10-18  5:46   ` Michael Kerrisk (man-pages)
  2 siblings, 1 reply; 15+ messages in thread
From: Paul Eggert @ 2020-10-18  1:05 UTC (permalink / raw)
  To: Alejandro Colomar, mtk.manpages; +Cc: linux-man, libc-alpha

On 10/17/20 2:37 PM, Alejandro Colomar via Libc-alpha wrote:
>   since POSIX.1-2008.
> +.PP
> +Prior to POSIX.1-2008,
> +the type was either an integer type or a real-floating type.

No actual POSIXish implementation ever made it a real-floating type, though, and 
that point should be made lest some conscientious programmer worry about a 
nonexistent porting issue.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] system_data_types.7: time_t: Add Versions note
  2020-10-18  1:05 ` [PATCH 1/3] system_data_types.7: time_t: Add Versions note Paul Eggert
@ 2020-10-18  5:46   ` Michael Kerrisk (man-pages)
  2020-10-18  9:02     ` Alejandro Colomar
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-10-18  5:46 UTC (permalink / raw)
  To: Paul Eggert, Alejandro Colomar; +Cc: mtk.manpages, linux-man, libc-alpha

On 10/18/20 3:05 AM, Paul Eggert wrote:
> On 10/17/20 2:37 PM, Alejandro Colomar via Libc-alpha wrote:
>>   since POSIX.1-2008.
>> +.PP
>> +Prior to POSIX.1-2008,
>> +the type was either an integer type or a real-floating type.
> 
> No actual POSIXish implementation ever made it a real-floating type, though, and 
> that point should be made lest some conscientious programmer worry about a 
> nonexistent porting issue.

Thanks for catching this, Paul!

Alex, I suggest either we drop this patch, or you could reword as
something like: 

"In POSIX.1-2001, the type was specified as being either an integer 
type or a real-floating type. However, existing implementations
used an integer type, and POSIX.1-2008 tightened the specification
to reflect this."

Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/3] system_data_types.7: Add 'clock_t'
  2020-10-17 21:37 ` [PATCH 2/3] system_data_types.7: Add 'clock_t' Alejandro Colomar
@ 2020-10-18  5:56   ` Michael Kerrisk (man-pages)
  2020-10-18  9:10     ` Alejandro Colomar
  2020-10-19 17:40     ` \- vs - (Was [Re: [PATCH 2/3] system_data_types.7: Add 'clock_t']) Alejandro Colomar
  0 siblings, 2 replies; 15+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-10-18  5:56 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, libc-alpha

Hi Alex,

On 10/17/20 11:37 PM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
> ---
> 
> Hi Michael,
> 
> Does that dash (in "real-floating") need to be escaped?

No.

> In my terminal I see it correctly,
> but I've seen you escaping some of them and don't know the reason why.

See man-pages(7):

   Real minus character
       Where a real minus character is required (e.g., for  numbers  such
       as  -1,  for  man  page cross references such as utf-8(7), or when
       writing options that have a leading dash, such as in  ls -l),  use
       the following form in the man page source:

           \-

       This guideline applies also to code examples.

The point is that a real-minux sign is needed to that code snippets
can be cut and pasted.

> Should they be escaped always, or is it only sometimes, and when?

In normal text, no escape is needed.

>  man7/system_data_types.7 | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)


> diff --git a/man7/system_data_types.7 b/man7/system_data_types.7
> index dc5f65c0d..6a1442ccd 100644
> --- a/man7/system_data_types.7
> +++ b/man7/system_data_types.7
> @@ -85,6 +85,28 @@ See also:
>  .BR aio_write (3),
>  .BR lio_listio (3)
>  .RE
> +.\"------------------------------------- clock_t ----------------------/
> +.TP
> +.I clock_t
> +.RS
> +Include:
> +.I <time.h>
> +or
> +.IR <sys/types.h> .
> +Alternatively,
> +.IR <sys/time.h> .
> +.PP
> +Used for system time in clock ticks.

Please make it:
"Used for system time either in clock ticks or CLOCKS_PER_SEC"

This type has a strange history. In my book, I note:

    Although the clock_t return type of clock() is the same
    data type that is used in the times() call, the units of
    measurement employed by these two interfaces are
    different. This is the result of historically conflicting
    definitions of clock_t in POSIX.1 and the C programming
    language standard.

> +According to POSIX,
> +it shall be an integer type or a real-floating type.
> +.PP
> +Conforming to:
> +C99 and later; POSIX.1-2001 and later.
> +.PP
> +See also:
> +.BR times (2),
> +.BR clock (3)
> +.RE
>  .\"------------------------------------- div_t ------------------------/
>  .TP
>  .I div_t

Cheers,

Michael



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] system_data_types.7: time_t: Add Versions note
  2020-10-18  5:46   ` Michael Kerrisk (man-pages)
@ 2020-10-18  9:02     ` Alejandro Colomar
  2020-10-18 13:05       ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 15+ messages in thread
From: Alejandro Colomar @ 2020-10-18  9:02 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages), Paul Eggert
  Cc: linux-man, libc-alpha, Zack Weinberg



On 2020-10-18 07:46, Michael Kerrisk (man-pages) wrote:
> On 10/18/20 3:05 AM, Paul Eggert wrote:
>> On 10/17/20 2:37 PM, Alejandro Colomar via Libc-alpha wrote:
>>>    since POSIX.1-2008.
>>> +.PP
>>> +Prior to POSIX.1-2008,
>>> +the type was either an integer type or a real-floating type.
>>
>> No actual POSIXish implementation ever made it a real-floating type, though, and
>> that point should be made lest some conscientious programmer worry about a
>> nonexistent porting issue.
> 
> Thanks for catching this, Paul!
> 
> Alex, I suggest either we drop this patch, or you could reword as
> something like:
> 
> "In POSIX.1-2001, the type was specified as being either an integer
> type or a real-floating type. However, existing implementations
> used an integer type, and POSIX.1-2008 tightened the specification
> to reflect this."
> 
> Thanks,
> 
> Michael
> 

Thanks, Paul!

Michael, I would opt for the simpler: drop the patch.

Thanks,

Alex

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/3] system_data_types.7: Add 'clock_t'
  2020-10-18  5:56   ` Michael Kerrisk (man-pages)
@ 2020-10-18  9:10     ` Alejandro Colomar
  2020-10-18 13:09       ` Michael Kerrisk (man-pages)
  2020-10-19 17:40     ` \- vs - (Was [Re: [PATCH 2/3] system_data_types.7: Add 'clock_t']) Alejandro Colomar
  1 sibling, 1 reply; 15+ messages in thread
From: Alejandro Colomar @ 2020-10-18  9:10 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, libc-alpha

Hi Michael,

On 2020-10-18 07:56, Michael Kerrisk (man-pages) wrote:
> Hi Alex,
> 
> On 10/17/20 11:37 PM, Alejandro Colomar wrote:
>> Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
>> ---
>>
>> Hi Michael,
>>
>> Does that dash (in "real-floating") need to be escaped?
> 
> No.
> 
>> In my terminal I see it correctly,
>> but I've seen you escaping some of them and don't know the reason why.
> 
> See man-pages(7):
> 
>     Real minus character
>         Where a real minus character is required (e.g., for  numbers  such
>         as  -1,  for  man  page cross references such as utf-8(7), or when
>         writing options that have a leading dash, such as in  ls -l),  use
>         the following form in the man page source:
> 
>             \-
> 
>         This guideline applies also to code examples.
> 
> The point is that a real-minux sign is needed to that code snippets
> can be cut and pasted.
> 
>> Should they be escaped always, or is it only sometimes, and when?
> 
> In normal text, no escape is needed.


Thanks.

> 
>>   man7/system_data_types.7 | 22 ++++++++++++++++++++++
>>   1 file changed, 22 insertions(+)
> 
> 
>> diff --git a/man7/system_data_types.7 b/man7/system_data_types.7
>> index dc5f65c0d..6a1442ccd 100644
>> --- a/man7/system_data_types.7
>> +++ b/man7/system_data_types.7
>> @@ -85,6 +85,28 @@ See also:
>>   .BR aio_write (3),
>>   .BR lio_listio (3)
>>   .RE
>> +.\"------------------------------------- clock_t ----------------------/
>> +.TP
>> +.I clock_t
>> +.RS
>> +Include:
>> +.I <time.h>
>> +or
>> +.IR <sys/types.h> .
>> +Alternatively,
>> +.IR <sys/time.h> .
>> +.PP
>> +Used for system time in clock ticks.
> 
> Please make it:
> "Used for system time either in clock ticks or CLOCKS_PER_SEC"
> 
> This type has a strange history. In my book, I note:
> 
>      Although the clock_t return type of clock() is the same
>      data type that is used in the times() call, the units of
>      measurement employed by these two interfaces are
>      different. This is the result of historically conflicting
>      definitions of clock_t in POSIX.1 and the C programming
>      language standard.


Ahhh now I get it.  So CLOCKS_PER_SEC doesn't mean CLOCK_TICKS_PER_SEC, 
right?  I always thought that it really was that, and clock() simply 
returned clock ticks.  But it looks like it returns an arbitrary 
division of the second called CLOCKS_PER_SEC.

I'll add " or CLOCKS_PER_SEC"

> 
>> +According to POSIX,
>> +it shall be an integer type or a real-floating type.
>> +.PP
>> +Conforming to:
>> +C99 and later; POSIX.1-2001 and later.
>> +.PP
>> +See also:
>> +.BR times (2),
>> +.BR clock (3)
>> +.RE
>>   .\"------------------------------------- div_t ------------------------/
>>   .TP
>>   .I div_t
> 
> Cheers,
> 
> Michael
> 
> 
> 

Thanks,

Alex

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] system_data_types.7: time_t: Add Versions note
  2020-10-18  9:02     ` Alejandro Colomar
@ 2020-10-18 13:05       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-10-18 13:05 UTC (permalink / raw)
  To: Alejandro Colomar, Paul Eggert
  Cc: mtk.manpages, linux-man, libc-alpha, Zack Weinberg

>> Alex, I suggest either we drop this patch, or you could reword as
>> something like:
>>
>> "In POSIX.1-2001, the type was specified as being either an integer
>> type or a real-floating type. However, existing implementations
>> used an integer type, and POSIX.1-2008 tightened the specification
>> to reflect this."
>>
>> Thanks,
>>
>> Michael
>>
> 
> Thanks, Paul!
> 
> Michael, I would opt for the simpler: drop the patch.

Okay.

Thanks,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/3] system_data_types.7: Add 'clock_t'
  2020-10-18  9:10     ` Alejandro Colomar
@ 2020-10-18 13:09       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-10-18 13:09 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, libc-alpha

Hello Alex,

>> This type has a strange history. In my book, I note:
>>
>>      Although the clock_t return type of clock() is the same
>>      data type that is used in the times() call, the units of
>>      measurement employed by these two interfaces are
>>      different. This is the result of historically conflicting
>>      definitions of clock_t in POSIX.1 and the C programming
>>      language standard.
> 
> 
> Ahhh now I get it.  So CLOCKS_PER_SEC doesn't mean CLOCK_TICKS_PER_SEC, 
> right?  I always thought that it really was that, and clock() simply 
> returned clock ticks.  But it looks like it returns an arbitrary 
> division of the second called CLOCKS_PER_SEC.

More or less. But the standard also says (in the <time.h> spec):

   The value of CLOCKS_PER_SEC shall be 1 million on 
   XSI-conformant systems.

(Yes, it is odd.)

Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] clock_t.3: New link to system_data_types(3)
  2020-10-17 21:37 ` [PATCH 3/3] clock_t.3: New link to system_data_types(3) Alejandro Colomar
@ 2020-10-18 16:52   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-10-18 16:52 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, libc-alpha

Hi Alex,

On 10/17/20 11:37 PM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
> ---
>  man3/clock_t.3 | 1 +
>  1 file changed, 1 insertion(+)
>  create mode 100644 man3/clock_t.3
> 
> diff --git a/man3/clock_t.3 b/man3/clock_t.3
> new file mode 100644
> index 000000000..db50c0f09
> --- /dev/null
> +++ b/man3/clock_t.3
> @@ -0,0 +1 @@
> +.so man7/system_data_types.7

Patch applied. (I nearly missed this, because you didn't
resend with the V2.)

Thanks,

Michael



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* \- vs - (Was [Re: [PATCH 2/3] system_data_types.7: Add 'clock_t'])
  2020-10-18  5:56   ` Michael Kerrisk (man-pages)
  2020-10-18  9:10     ` Alejandro Colomar
@ 2020-10-19 17:40     ` Alejandro Colomar
  2020-10-19 18:10       ` Jakub Wilk
  1 sibling, 1 reply; 15+ messages in thread
From: Alejandro Colomar @ 2020-10-19 17:40 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, libc-alpha



On 2020-10-18 07:56, Michael Kerrisk (man-pages) wrote:
> Hi Alex,
> 
> On 10/17/20 11:37 PM, Alejandro Colomar wrote:
>> Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
>> ---
>>
>> Hi Michael,
>>
>> Does that dash (in "real-floating") need to be escaped?
> 
> No.
> 
>> In my terminal I see it correctly,
>> but I've seen you escaping some of them and don't know the reason why.
> 
> See man-pages(7):
> 
>     Real minus character
>         Where a real minus character is required (e.g., for  numbers  such
>         as  -1,  for  man  page cross references such as utf-8(7), or when
>         writing options that have a leading dash, such as in  ls -l),  use
>         the following form in the man page source:
> 
>             \-
> 
>         This guideline applies also to code examples.
> 
> The point is that a real-minux sign is needed to that code snippets
> can be cut and pasted.
> 
>> Should they be escaped always, or is it only sometimes, and when?
> 
> In normal text, no escape is needed.


Hi Michael,

Then, in the following code (taken from printf.3)
the escape is wrong (unneeded) by those guidelines?:

[[
.SH NAME
printf, fprintf, dprintf, sprintf, snprintf, vprintf, vfprintf, vdprintf,
vsprintf, vsnprintf \- formatted output conversion
]]

Thanks,

Alex

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: \- vs - (Was [Re: [PATCH 2/3] system_data_types.7: Add 'clock_t'])
  2020-10-19 17:40     ` \- vs - (Was [Re: [PATCH 2/3] system_data_types.7: Add 'clock_t']) Alejandro Colomar
@ 2020-10-19 18:10       ` Jakub Wilk
  2020-10-19 22:11         ` Alejandro Colomar
  2020-10-21 21:19         ` G. Branden Robinson
  0 siblings, 2 replies; 15+ messages in thread
From: Jakub Wilk @ 2020-10-19 18:10 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: Michael Kerrisk, linux-man

* Alejandro Colomar <colomar.6.4.3@gmail.com>, 2020-10-19, 19:40:
>Then, in the following code (taken from printf.3)
>the escape is wrong (unneeded) by those guidelines?:
>
>[[
>.SH NAME
>printf, fprintf, dprintf, sprintf, snprintf, vprintf, vfprintf, vdprintf,
>vsprintf, vsnprintf \- formatted output conversion
>]]

From the typographical point of view, the most appropriate character 
here would be \(en (en-dash); but for historical reasons, you're 
supposed to use \- (minus sign). This is documented in the man(7) manual 
page, section "Sections".

-- 
Jakub Wilk

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: \- vs - (Was [Re: [PATCH 2/3] system_data_types.7: Add 'clock_t'])
  2020-10-19 18:10       ` Jakub Wilk
@ 2020-10-19 22:11         ` Alejandro Colomar
  2020-10-21 21:19         ` G. Branden Robinson
  1 sibling, 0 replies; 15+ messages in thread
From: Alejandro Colomar @ 2020-10-19 22:11 UTC (permalink / raw)
  To: Jakub Wilk; +Cc: Michael Kerrisk, linux-man

Hi Jakub,

On 2020-10-19 20:10, Jakub Wilk wrote:
> * Alejandro Colomar <colomar.6.4.3@gmail.com>, 2020-10-19, 19:40:
>> Then, in the following code (taken from printf.3)
>> the escape is wrong (unneeded) by those guidelines?:
>>
>> [[
>> .SH NAME
>> printf, fprintf, dprintf, sprintf, snprintf, vprintf, vfprintf, vdprintf,
>> vsprintf, vsnprintf \- formatted output conversion
>> ]]
> 
>  From the typographical point of view, the most appropriate character 
> here would be \(en (en-dash); but for historical reasons, you're 
> supposed to use \- (minus sign). This is documented in the man(7) manual 
> page, section "Sections".
> 


Thank you!

Alex

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: \- vs - (Was [Re: [PATCH 2/3] system_data_types.7: Add 'clock_t'])
  2020-10-19 18:10       ` Jakub Wilk
  2020-10-19 22:11         ` Alejandro Colomar
@ 2020-10-21 21:19         ` G. Branden Robinson
  1 sibling, 0 replies; 15+ messages in thread
From: G. Branden Robinson @ 2020-10-21 21:19 UTC (permalink / raw)
  To: linux-man


[-- Attachment #1: Type: text/plain, Size: 3576 bytes --]

Hi, Jakub!

At 2020-10-19T20:10:47+0200, Jakub Wilk wrote:
> * Alejandro Colomar <colomar.6.4.3@gmail.com>, 2020-10-19, 19:40:
> > Then, in the following code (taken from printf.3)
> > the escape is wrong (unneeded) by those guidelines?:
> > 
> > [[
> > .SH NAME
> > printf, fprintf, dprintf, sprintf, snprintf, vprintf, vfprintf,
> > vdprintf, vsprintf, vsnprintf \- formatted output conversion
> > ]]
> 
> From the typographical point of view, the most appropriate character
> here would be \(en (en-dash);

I agree with your conclusion below, but I don't believe the above is
correct; there is a long tradition (that I learned from Knuth's TeXbook)
of using en dashes exclusively for numeric ranges[1], though I found a
source[2] that advises its use for non-numeric ranges like airline
route expressions, sports scores, and "complex compound adjectives"[3].
In none of these, however, is the en-dash surrounded by whitespace.

> but for historical reasons, you're supposed to use \- (minus sign).

There's a very _good_ historical reason not to use the en-dash, in that
it was not supported by the AT&T nroff and troff systems used to compose
the earliest Unix manuals[4].  There was no special character escape
documented for it in either the 1976 or 1992 revisions of CSTR #54, the
(Nroff/)Troff User's Manual[5].  You motivated me to do some quick
research; \(en was eventually coined and made its way into Documenter's
Workbench troff, Plan 9 troff, Solaris troff, and Heirloom Doctools
troff, all of which are source descendants of AT&T troff, and of course
GNU troff, which is an independent implementation.  None define it for
all of their output drivers, which makes sense as like any glyph, it's
dependent upon font support.

The Seventh Edition Unix man pages (the first to use the man(7) macro
package), as far as my greps can tell, 100% consistent about using
"<space>\-<space>" to set off the page title(s) from the summary in the
Name section.

mandb(8) implementations are generous in what they accept; the
lexgrog(1) in Colin Watson's man-db package accepts any of:

  --, \(hy, \(mi, \(en, and \(em

...plus the groff forms of the special character escapes (\[xx]), and is
similarly tolerant of whitespace abutting them on either end[6].  Only
a lone hyphen-minus is excepted from the above; I assume that is because
it is too hard to reliably disambiguate from occurrences within page
topic names--like man-pages(7).  However, this generosity is no reason
to over-interpret Postel's Law and advocate chaos.

Given that style authorities are divided over whether em-dashes mandate
or forbid whitespace around them[7], I think it best to regard the
topic/summary separator character as _sui generis_, and \-, which means
nothing in ordinary typography is consequently an excellent choice.

Regards,
Branden

[1] http://visualmatheditor.equatheque.net/doc/texbook.pdf (p. 4, PDF
    page 15)
[2] https://www.grammarly.com/blog/en-dash/
[3] Apparently, one example would be "I prepared an old favorite
    beverage of his, a vanilla ice cream–India pale ale float."
[4] More accurately, the v1 Unix manual (1971) was composed with roff
    ("old roff", as it was subsequently called).  nroff ("new roff") was
    not written until 1972[8].
[5] The title was changed over the course of its lifetime.
[6] https://git.savannah.nongnu.org/cgit/man-db.git/tree/src/lexgrog.l
[7] https://www.thepunctuationguide.com/em-dash.html
[8] https://manpages.bsd.lv/history/mcilroy_21_10_2011.txt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, back to index

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-17 21:37 [PATCH 1/3] system_data_types.7: time_t: Add Versions note Alejandro Colomar
2020-10-17 21:37 ` [PATCH 2/3] system_data_types.7: Add 'clock_t' Alejandro Colomar
2020-10-18  5:56   ` Michael Kerrisk (man-pages)
2020-10-18  9:10     ` Alejandro Colomar
2020-10-18 13:09       ` Michael Kerrisk (man-pages)
2020-10-19 17:40     ` \- vs - (Was [Re: [PATCH 2/3] system_data_types.7: Add 'clock_t']) Alejandro Colomar
2020-10-19 18:10       ` Jakub Wilk
2020-10-19 22:11         ` Alejandro Colomar
2020-10-21 21:19         ` G. Branden Robinson
2020-10-17 21:37 ` [PATCH 3/3] clock_t.3: New link to system_data_types(3) Alejandro Colomar
2020-10-18 16:52   ` Michael Kerrisk (man-pages)
2020-10-18  1:05 ` [PATCH 1/3] system_data_types.7: time_t: Add Versions note Paul Eggert
2020-10-18  5:46   ` Michael Kerrisk (man-pages)
2020-10-18  9:02     ` Alejandro Colomar
2020-10-18 13:05       ` Michael Kerrisk (man-pages)

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git