Page MenuHome GnuPG

doc: U+2010 HYPHEN vs. U+002D HYPHEN-MINUS for man pages
Open, WishlistPublic

Description

If it were written for man-only, we should distinguish character usage of U+2010 and U+002D.
We maintain the documents in Texinfo as source format and generate man pages by yat2man.
In this situation, I'm not sure how to handle the problem reported for our man pages:

https://bugs.debian.org/1050042
https://bugs.debian.org/1041731

Possibly, we somehow put a workaround into yat2man.

Event Timeline

gniibe triaged this task as Wishlist priority.Aug 22 2023, 3:32 AM
gniibe created this task.

Ideally, we should change the source document to use @minus{} for a minus sign, and keep - only when it means a hyphen. But we cannot do that blindly; We need to handle it with care, in a way of case by case (Texinfo manual suggests no use of @minus{} with @code or @example, but it is needed for groff man pages in many cases).... We would need to consider each occurrence of - in our document. That's too much (if it were me to fix).

My workaround (not perfect) would be modification of yat2man like following:

diff --git a/doc/yat2m.c b/doc/yat2m.c
index c2806e3..9d94bd9 100644
--- a/doc/yat2m.c
+++ b/doc/yat2m.c
@@ -775,8 +775,11 @@ write_th (FILE *fp)
 
     }
   else
-    fprintf (fp, ".TH %s %s %s \"%s\" \"%s\"\n",
-             name, p, isodatestring (), opt_release, opt_source);
+    {
+      fputs (".char - \\-\n", fp);
+      fprintf (fp, ".TH %s %s %s \"%s\" \"%s\"\n",
+               name, p, isodatestring (), opt_release, opt_source);
+    }
 
   free (name);
   return 0;

That is, to treat - in the source as minus sign for man pages.
This may be wrong for perfectionist, but it's backward compatible.

gniibe mentioned this in Unknown Object (Event).Mon, Aug 28, 6:40 AM

I guess we should follow the GNU standards and provide only info files ;-)