[indent] texinfo2man.c - rendering dash/hyphen/minus

Brian Inglis <[email protected]> Thu, 5 Feb 2026 12:04:23 -0700
Newsgroups gmane.comp.gnu.indent.bugs
Organization Systematic Software
Message-ID <[email protected]>
Hi folks,

This issue was originally raised by a user who could not use the 'which(1)' man 
page example commands by copying and pasting into the shell.

Investigation revealed that the which package build required indent as a git 
submodule to use indent texinfo2man(.c) to generate the man page source.

Package indent texinfo2man.c texinfo to man page converter does not seem to 
handle option -o or --option dashes or any word with leading dashes in literal 
text brackets, or embedded dashes in for example 
@code/kd/key/samp/verb/env/file/command/option/indicateurl/email/example/verbatim/verbatiminclude 
such that users can copy and paste the text into a file to compile or command 
line to execute and have it run successfully.

In order to do so, the dash (Unicode U+002D HYPHEN-MINUS) in man pages must be 
escaped by a preceding escape character '\[ec]' by default '\' as '\-' to be 
rendered by `groff -man` (or `mdoc` AFAIK) as text '-' otherwise it is 
interpreted as a hyphen and rendered as '‐' U+2010 HYPHEN.
Interestingly, your indent.1 synopsis uses escaped '\-' rendered as expected, 
while your option definitions do not, rendered as hyphens:

.B "indent "
\-\-version
.SH "DESCRIPTION"
--
.TP
.B -version\fR
Output the version number of \fBindent\fR.
.br

You may want to consider the advice and renderings in groff(7), groff_char(7), 
and groff_rfc1345(7) and the input characters uses within literal text brackets, 
especially also *quotes* which had issues in the past.

Dumping four UTF-8 hyphen code points and character strings - second is zero 
width SOFT HYPHEN entered with *COMPOSE* pseudo-key:

$ utf8cp - ­ ‐ ‑
  -  U+00002d  2d
  ­  U+0000ad  c2 ad
  ‐  U+002010  e2 80 90
  ‑  U+002011  e2 80 91

[I have not yet investigated whether `texi2any --docbook | docbook2man` or some 
other pipeline might give a better rendering?] ;^>

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher  but when there is no more to cut
                                 -- Antoine de Saint-Exupéry