groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] ASCII Minus Sign in man Pages


From: James K. Lowden
Subject: Re: [Groff] ASCII Minus Sign in man Pages
Date: Wed, 3 May 2017 20:13:18 -0400

On Wed, 3 May 2017 13:42:55 -0400
Mike Bianchi <address@hidden> wrote:

> The  -  character exists on all keyboards.  It is not labeled minus
> or hyphen or endash.  It generates the decimal 45 (hex 0x2D, octal
> 055) character. That any *roff processor would give it a different
> meaning is most unfortunate.

IMO that is the principal that should be applied: every unadorned
character appearing in troff input should represent itself.  If  you
want something other than that, groff_char(7) describes your options.  

IIUC, this debate about how to render - and \- stems from a conflict in
historical practice.  Is the following correct?  

        When troff was young, terminals were ascii and the - character
was 0x2d.  Manpage guidelines encouraged the use of \- for flags because
they rendered nicely in printed documents with no harm done to nroff
output.  They did that despite the obvious fact that the manpage is
there to describe what to type, and basically no one can type the
denoted character.  

        Then Unicode pronounced that 0x2d was neither fish nor fowl,
and gave us hyphen, minus, and endash characters.  groff dutifully
mapped - onto hyphen \- onto minus.  But when terminals gained Unicode
capability, some of them lost cut-and-paste convenience.  The debate is
over how to recover that convenience.  

Oddly, my system doesn't exibit any cut-and-paste anomaly despite
using xterm with the "-en UTF-8" option.  Searching for - in less also
works.

If it's a UI issue we're confronting, perhaps it's really up to the UI
to deal with.  The man utility can certainly impose on nroff the
requirement that - and \- both render as 0x2d.  Then it shows up
correctly in the pager.  It is visually acceptable to the user, and
DTRT regarding the UI.  (Maybe that's what Ubuntu LTS does for me; I
don't know.) 

It's not obvious to me groff should make any change at all.  At most,
reverting the mapping of - so that it outputs 0x2d again would undo a
nonobvious, subtle change in favor of simplicity.  

Possibly some degree of outreach to the UI community would be service,
too.  

--jkl











reply via email to

[Prev in Thread] Current Thread [Next in Thread]