From 5a1c023cd36448886711237c02248b6c872d5cd0 Mon Sep 17 00:00:00 2001 From: "Steffen (Daode) Nurpmeso" Date: Fri, 10 Feb 2017 18:28:29 +0100 Subject: [PATCH] nail.1: furtherly clarify doc. of \cX (Doug McIlroy).. Doug McIlroy pointed out at TUHS, where i impertinently copied+pasted the -- then false -- \cX documentation: |Except for the ISO citations, this paragraph says the same |thing more succinctly. | |'\cX' represents a nonprintable character Y in terms of the | printable character X whose binary code is obtained | by adding 0x40 (decimal 64) to that for Y. (In some | historical contexts, '^' plays the role of '\c'.) | Alternative standard representations for certain | nonprinting characters, e.g. '\a', '\n', '\t' above, | are preferred by S-nail. '\c@' (NUL) serves as a | string terminator regardless of following characters. | |And this version, 1/3 the length of the original, tells all |one really needs to know. | |'\cX' represents a nonprintable character Y in terms of the | printable character X whose binary code is obtained | by adding 0x40 (decimal 64) to that for Y. '\c@' | (NUL) serves as a string terminator regardless of | following characters. This is not what i commit, since for my personal taste, at the time of this writing, the above is too concise for many. The commit, and the respond that lingers in the other window, took an entire afternoon. --- nail.1 | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/nail.1 b/nail.1 index 33e1c17a..2c7c49b9 100644 --- a/nail.1 +++ b/nail.1 @@ -2920,7 +2920,7 @@ A 0 byte will suppress further output for the quoted argument. the Unicode / ISO-10646 character with the hexadecimal codepoint value .Ql HHHHHHHH (one to eight hexadecimal digits) \(em note that Unicode defines the -maximum codepoint to be ever supported as +maximum codepoint ever to be supported as .Ql 0x10FFFF (in planes of .Ql 0xFFFF @@ -2935,16 +2935,15 @@ Identical to .Ql \eUHHHHHHHH except it takes only one to four hexadecimal digits. .It Ql \ecX -A mechanism that allows usage of the non-printable (ASCII and -compatible) control codes 0 to 31: to create the printable -representation of a control code the numeric value 64 is added, and the -resulting ASCII character set code point is then printed, e.g., BEL is +Emits the non-printable (ASCII and compatible) C0 control codes +0 (NUL) to 31 (US), and 127 (DEL). +Printable representations of ASCII control codes can be created by +mapping them to a different part of the ASCII character set, which is +possible by adding the number 64 for the codes 0 to 31, e.g., 7 (BEL) is .Ql 7 + 64 = 71 = G . -In reality, however, this is not true, because the calculation is not an -addition, but a logical bitwise XOR operation (see -.Ic vexpr ) : -this explains why the ASCII control character DEL with the numeric value -127 ends up as a question mark, with the numeric value 63: +The real operation is a bitwise logical XOR with 64 (bit 7 set, see +.Ic vexpr ) , +thus also covering code 127 (DEL), which is mapped to 63 (question mark): .Ql vexpr ^ 127 64 . .Pp Whereas historically circumflex notation has often been used for @@ -2952,15 +2951,16 @@ visualization purposes of control codes, e.g., .Ql ^G , the reverse solidus notation has been standardized: .Ql \ecG . -Some control codes also have standardized (ISO 10646, ISO C) alias -representations, as shown above (e.g., +Some control codes also have standardized (ISO 10646, ISO C) aliases, +as shown above (e.g., .Ql \ea , .Ql \en , .Ql \et ) : -whenever such an alias exists \*(UA will use it for display purposes. +whenever such an alias exists it will be used for display purposes. The control code NUL -.Pf ( Ql \ec@ ) -ends argument processing without producing further output. +.Pf ( Ql \ec@ , +a non-standard extension) ends argument processing without producing +further output. .It Ql \e$NAME Non-standard extension: expand the given variable name, as above. Brace enclosing the name is supported. -- 2.11.4.GIT