NetBSD Problem Report #46784

From spz@tucana.1st.de  Wed Aug  8 07:19:28 2012
Return-Path: <spz@tucana.1st.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 03BE763B85F
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  8 Aug 2012 07:19:27 +0000 (UTC)
Message-Id: <20120808071913.C8129FF68@tucana.1st.de>
Date: Wed,  8 Aug 2012 07:19:13 +0000 (UTC)
From: spz@tucana.1st.de
Reply-To: spz@tucana.1st.de
To: gnats-bugs@gnats.NetBSD.org
Subject: "pretty" dashes in manpages make copying from manpages inadvisable
X-Send-Pr-Version: 3.95

>Number:         46784
>Category:       bin
>Synopsis:       the dashes used for command options don't work
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 08 07:20:00 +0000 2012
>Closed-Date:    Wed Jan 01 22:38:25 +0000 2020
>Last-Modified:  Thu Jan 02 15:40:00 +0000 2020
>Originator:     S.P.Zeidler
>Release:        NetBSD 6.99.10
>Organization:
	dis-
>Environment:
System: NetBSD tucana.1st.de 6.99.10 NetBSD 6.99.10 (TUCANA) #39: Mon Jul 30 10:01:47 CEST 2012 root@tucana.1st.de:/home/netbsd/amd64/kernobj/TUCANA amd64
Architecture: x86_64
Machine: amd64
>Description:
	take for example:
	--- snip ---
	tucana# vnconfig ‐u vnd0
	vnconfig: /dev/r‐ud: opendisk: No such file or directory
	tucana# vnconfig -u vnd0
	tucana#
	--- snip ---
	The first version was copied from the man page.

	Having synopsis, examples etc in manpages you can't actually use
	is a great way to get rid of new users and to annoy existing ones.

	.Fl needs to produce something that actually works.
	.Op Fl, too
>How-To-Repeat:

>Fix:


>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: misc/46784: "pretty" dashes in manpages make copying from manpages inadvisable
Date: Wed, 8 Aug 2012 10:48:51 +0200

 Please describe a bit more of your environment and what "copied from the
 man page" actually means.

 If I use "man vnconfig" in an rxvt and select the synopsis example, then
 paste it (via X) into another rxvt/tcsh, I get exactly what I expect and
 no decoration. Works the same with xterm.

 Might also depend on your locale settings.

 Martin

From: "S.P.Zeidler" <spz@serpens.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: misc/46784: "pretty" dashes in manpages make copying from
 manpages inadvisable
Date: Wed, 8 Aug 2012 22:07:47 +0200

 Thus wrote Martin Husemann (martin@duskware.de):

 >  Please describe a bit more of your environment and what "copied from the
 >  man page" actually means.

 X cut & paste, from/to xterms

 The problematic behaviour seems to be a result of using an UTF8 LC_CTYPE.
 With LC_CTYPE=de_DE.UTF-8 or LC_CTYPE=en_US.UTF-8 I get e2 88 92 as dash
 instead of 2d.

 (As checked via man echo > echo.out; hexdump -C echo.out)

 regards,
 	spz
 -- 
 spz@serpens.de (S.P.Zeidler)

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: misc/46784: "pretty" dashes in manpages make copying from
 manpages inadvisable
Date: Thu, 9 Aug 2012 05:52:16 +0000

 On Wed, Aug 08, 2012 at 08:10:08PM +0000, S.P.Zeidler wrote:
  >  >  Please describe a bit more of your environment and what "copied from the
  >  >  man page" actually means.
  >  
  >  X cut & paste, from/to xterms
  >  
  >  The problematic behaviour seems to be a result of using an UTF8 LC_CTYPE.
  >  With LC_CTYPE=de_DE.UTF-8 or LC_CTYPE=en_US.UTF-8 I get e2 88 92 as dash
  >  instead of 2d.
  >  
  >  (As checked via man echo > echo.out; hexdump -C echo.out)

 I see this behavior with nroff -mdoc (that is, groff) but not running
 mandoc. I though man(1) ran mandoc these days, but apparently it
 doesn't.

 -- 
 David A. Holland
 dholland@netbsd.org

Responsible-Changed-From-To: misc-bug-people->bin-bug-people
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Thu, 09 Aug 2012 05:56:17 +0000
Responsible-Changed-Why:
problem is in groff, which is too gung-ho about utf-8


From: "S.P.Zeidler" <spz@serpens.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/46784
Date: Thu, 9 Aug 2012 11:32:48 +0200

 Thus wrote David Holland (dholland-bugs@NetBSD.org):

 >   >  The problematic behaviour seems to be a result of using an UTF8 LC_CTYPE.
 >   >  With LC_CTYPE=de_DE.UTF-8 or LC_CTYPE=en_US.UTF-8 I get e2 88 92 as dash
 >   >  instead of 2d.
 >  
 >  I see this behavior with nroff -mdoc (that is, groff) but not running
 >  mandoc. I though man(1) ran mandoc these days, but apparently it
 >  doesn't.

 It depends on what's in your man.conf; the -current man.conf makes man use
 mandoc.

 Since the issue only hits people with an old man.conf who use UTF-8
 locales (i.e. not the default new user) I have changed the priority to
 low.

 regards,
 	spz
 -- 
 spz@serpens.de (S.P.Zeidler)

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/46784
Date: Mon, 13 Aug 2012 18:52:05 +0000

 On Thu, Aug 09, 2012 at 09:35:02AM +0000, S.P.Zeidler wrote:
  >  >  I see this behavior with nroff -mdoc (that is, groff) but not running
  >  >  mandoc. I though man(1) ran mandoc these days, but apparently it
  >  >  doesn't.
  >  
  >  It depends on what's in your man.conf; the -current man.conf makes man use
  >  mandoc.

 Huh, I didn't realize man.conf could control that. Maybe we should
 have postinstall update it.

  >  Since the issue only hits people with an old man.conf who use UTF-8
  >  locales (i.e. not the default new user) I have changed the priority to
  >  low.

 Fine by me.

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: open->closed
State-Changed-By: spz@NetBSD.org
State-Changed-When: Wed, 01 Jan 2020 22:38:25 +0000
State-Changed-Why:
no longer an issue on a system with updated etc (and under support)
.


From: Valery Ushakov <uwe@stderr.spb.ru>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: misc/46784: "pretty" dashes in manpages make copying from
 manpages inadvisable
Date: Thu, 2 Jan 2020 18:36:30 +0300

 On Wed, Aug 08, 2012 at 07:20:00 +0000, spz@tucana.1st.de wrote:

 > .Fl needs to produce something that actually works.

 Ascii quotes are another vicim of this (see e.g. sh(1) page).

 It would be nice to fix this even if man now uses mandoc(1) by
 default.

 From external/gpl2/groff/dist/PROBLEMS

   * The UTF-8 output of grotty has strange characters for the minus, the
     hyphen, and the right quote.  Why?

   The used Unicode characters (U+2212 for the minus sign and U+2010 for
   the hyphen) are the correct ones, but many programs can't search them
   properly.  The same is true for the right quote (U+201D).  To map those
   characters back to the ASCII characters, insert the following code
   snippet into the `troffrc' configuration file:

   .if '\*[.T]'utf8' \{\
   .  char \- \N'45'
   .  char  - \N'45'
   .  char  ' \N'39'
   .\}

 Remapping the ascii quote like that messes with quoting macros,
 though.


 heirloom doctools roff is more considerate, see its .utf8conv command:

   ... "\-" remains the ASCII hyphen-minus character. This is because
   in manual pages, "\-" represents the ASCII option introduction
   character, and converting it to a UTF-8 minus character would make
   it impossible to copy-and-paste option descriptions.  Similar
   considerations apply to ` ' vs. \` \'.  The former are typographic
   single quotes, while the latter are commonly used for the ASCII
   syntax quotes in manual pages.

 I'm not sure about \' as the heirloom doctool nroff I have handy
 interprets \' as acute accent, like groff also does.  But to get ascii
 quote (from both groff and heirloom) you can use \(aq which is a bit
 annoying but at least the possibility is there.

 As for \-, groff is really determined to prettify it, so there's no
 choice but to remap it.

 To sum it up:

 '   \(aq - ascii single quote
 `   \`   - backquote
 -   \-   - ascii hyphen-minus (with the above hack for groff)

 There's still \(mi for unicode minus, but in the manual page context
 we probably still want ascii minus for things like \-1, but if need
 bee (e.g. some math formula) the fancy minus is still accessible.

 -uwe

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.