Subject: bug#37530: 26.1; Tack characters translated incorrectly

From: Axel Svensson <[email-masked]>
Date: Fri, 27 Sep 2019 19:19:46 +0200

On Fri, Sep 27, 2019 at 5:33 PM Eli Zaretskii <[email-masked]> wrote:
> I thought that older versions might perhaps assign different mappings
> to the same keysyms.  If they don't assign any mappings, then I agree
> with you.

XKB lists quite a few keysyms as deprecated, but no keysyms we have
discussed here are affected.
I believe this indicates that they have never been used for another
mapping previously, but I haven't checked extensively.

However, it is also stated in xkbcommon-keysyms.h that:
> * Where the correspondence is either not one-to-one or semantically
> * unclear, the Unicode position and name are enclosed in
> * parentheses. Such legacy keysyms should be considered deprecated
> * and are not recommended for use in future keyboard mappings.

This affects four of the keysyms mentioned:
> #define XKB_KEY_signifblank                   0x0aac  /*(U+2423 OPEN BOX)*/
> #define XKB_KEY_leftanglebracket              0x0abc  /*(U+27E8 MATHEMATICAL LEFT ANGLE BRACKET)*/
> #define XKB_KEY_decimalpoint                  0x0abd  /*(U+002E FULL STOP)*/
> #define XKB_KEY_rightanglebracket             0x0abe  /*(U+27E9 MATHEMATICAL RIGHT ANGLE BRACKET)*/

For two of these keysyms, I managed to find at least one application
that agrees with the current Emacs mapping that we now consider
changing:
> {0xabc, 0x2329},
> {0xabe, 0x232a},
See https://fossies.org/dox/putty-src/xkeysym_8c_source.html

I believe that we should consider carefully whether changing these two
mappings could introduce a regression for some use case, e.g.
PuTTY/ssh/emacs.

My proposed changes are attached.
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 56061371fe..17bbbaeb12 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -579,6 +579,7 @@ as returned by `x-server-vendor'."
 	(#x6aa . ?њ)
 	(#x6ab . ?ћ)
 	(#x6ac . ?ќ)
+	(#x6ad . ?ґ) ;; Source: xkbcommon-keysyms.h
 	(#x6ae . ?ў)
 	(#x6af . ?џ)
 	(#x6b0 . ?№)
@@ -594,6 +595,7 @@ as returned by `x-server-vendor'."
 	(#x6ba . ?Њ)
 	(#x6bb . ?Ћ)
 	(#x6bc . ?Ќ)
+	(#x6bd . ?ґ) ;; Source: xkbcommon-keysyms.h
 	(#x6be . ?Ў)
 	(#x6bf . ?Џ)
 	(#x6c0 . ?ю)
@@ -810,6 +812,7 @@ as returned by `x-server-vendor'."
 	(#xaa8 . ? )
 	(#xaa9 . ?—)
 	(#xaaa . ?–)
+	(#xaac . ?␣) ;; Source: xkbcommon-keysyms.h
 	(#xaae . ?…)
 	(#xaaf . ?‥)
 	(#xab0 . ?⅓)
@@ -822,7 +825,15 @@ as returned by `x-server-vendor'."
 	(#xab7 . ?⅚)
 	(#xab8 . ?℅)
 	(#xabb . ?‒)
+	;; In xkbcommon-keysyms.h, the keysyms 0xabc and 0xabe are listed as
+	;; U+27E8 and U+27E9 respectively. However, the parenthesis indicate
+	;; that these mappings are not one-to-one and that these keysyms are
+	;; deprecated. In order to not introduce any incompatibility with
+	;; possible existing workflows that expect these keysyms to map as they
+	;; currently do, to 0x2329 and 0x232a, respectively, they are left as
+	;; they are. In particular, PuTTY is known to agree with this mapping.
 	(#xabc . ?〈)
+	(#xabd . ?.) ;; Source: xkbcommon-keysyms.h
 	(#xabe . ?〉)
 	(#xac3 . ?⅛)
 	(#xac4 . ?⅜)
@@ -839,6 +850,7 @@ as returned by `x-server-vendor'."
 	(#xad2 . ?“)
 	(#xad3 . ?”)
 	(#xad4 . ?℞)
+	(#xad5 . ?‰) ;; Source: xkbcommon-keysyms.h
 	(#xad6 . ?′)
 	(#xad7 . ?″)
 	(#xad9 . ?✝)
@@ -883,20 +895,28 @@ as returned by `x-server-vendor'."
 	(#xba8 . ?∨)
 	(#xba9 . ?∧)
 	(#xbc0 . ?¯)
-	(#xbc2 . ?⊥)
+	(#xbc2 . ?⊤)
+	;; Source for #xbc2: xkbcommon-keysyms.h. Note that the
+	;; `KEYSYM Encoding' appendix to the X protocol definition is incorrect.
 	(#xbc3 . ?∩)
 	(#xbc4 . ?⌊)
 	(#xbc6 . ?_)
 	(#xbca . ?∘)
 	(#xbcc . ?⎕)
-	(#xbce . ?⊤)
+	(#xbce . ?⊥)
+	;; Source for #xbce: xkbcommon-keysyms.h. Note that the
+	;; `KEYSYM Encoding' appendix to the X protocol definition is incorrect.
 	(#xbcf . ?○)
 	(#xbd3 . ?⌈)
 	(#xbd6 . ?∪)
 	(#xbd8 . ?⊃)
 	(#xbda . ?⊂)
-	(#xbdc . ?⊢)
-	(#xbfc . ?⊣)
+	(#xbdc . ?⊣)
+	;; Source for #xbdc: xkbcommon-keysyms.h. Note that the
+	;; `KEYSYM Encoding' appendix to the X protocol definition is incorrect.
+	(#xbfc . ?⊢)
+	;; Source for #xbfc: xkbcommon-keysyms.h. Note that the
+	;; `KEYSYM Encoding' appendix to the X protocol definition is incorrect.
 	;; Hebrew
 	(#xcdf . ?‗)
 	(#xce0 . ?א)
@@ -1143,6 +1163,9 @@ as returned by `x-server-vendor'."
 ;; #x0aff	CURSOR	Publish
 ;; #x0dde	THAI MAIHANAKAT	Thai
 
+;; However, xkbcommon-keysyms.h do have mappings for #x0aac and #x0abd,
+;; which are used above.
+
 
 ;;;; Selections