bug-ncurses
[Top][All Lists]
Advanced

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

[PATCH 2/9] man/clear.1: Add string for neutral apostrophe.


From: G. Branden Robinson
Subject: [PATCH 2/9] man/clear.1: Add string for neutral apostrophe.
Date: Mon, 25 Sep 2023 15:00:09 -0500

Like neutral double quotes ("), this is a tricky character/glyph.
Fortunately, there is a fairly portable solution.

Define a new string named `'`.  On formatters claiming groff
compatibility (by setting the `.g` register), define the string's
contents as the special character `aq`.

If we are formatting for a typesetter (the condition `t` is true) on a
non-groff formatter, do the same thing.  DWB 3.3 troff's "post"
(PostScript) device defines this special character.  Heirloom Doctools
troff, descended from DWB, does as well.

Otherwise, we are formatting for a terminal with a non-groff formatter.
Assume a character encoding without typographer's quotes is in use, and
output "'" as-is.

Fixes problem with ' appearing as U+2019 on groff output devices like
"ps", "pdf", and "utf8".

Tested with groff, mandoc, Heirloom Doctools nroff and troff, and
Documenter's Workbench (DWB) 3.3 nroff and troff.  DWB troff's "post"
device gets this wrong, making \(aq an alias of `\(aa` and '\`'
(quotation style switched away from Markdown for clarity).  Heirloom
corrects this.  That's an unfortunate flaw, but I as far as I know, DWB
is not used as production software anywhere.  I test with it to try to
predict commercial/proprietary Unix troff behavior.
---
 man/clear.1 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/man/clear.1 b/man/clear.1
index d16e64be..c015b8da 100644
--- a/man/clear.1
+++ b/man/clear.1
@@ -54,12 +54,15 @@
 .ie \n(.g \{\
 .ds `` \(lq
 .ds '' \(rq
+.ds '  \(aq
 .\}
 .el \{\
 .ie t .ds `` ``
 .el   .ds `` ""
 .ie t .ds '' ''
 .el   .ds '' ""
+.ie t .ds '  \(aq
+.el   .ds '  '
 .\}
 .
 .de bP
@@ -133,12 +136,12 @@ .SH HISTORY
 sequence for clearing the screen.
 Rather than clearing just the visible part of the screen using
 .NS
-printf '\\033[2J'
+printf \*'\\033[2J\*'
 .NE
 .IP
 one could clear the \fIscrollback\fP using
 .NS
-printf '\\033[\fB3\fPJ'
+printf \*'\\033[\fB3\fPJ\*'
 .NE
 .IP
 This is documented in \fIXTerm Control Sequences\fP as a feature originating
-- 
2.30.2

Attachment: signature.asc
Description: PGP signature


reply via email to

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