GNU bug report logs - #37530
26.1; Tack characters translated incorrectly

Previous Next

Package: emacs;

Reported by: Axel Svensson <mail <at> axelsvensson.com>

Date: Thu, 26 Sep 2019 21:33:02 UTC

Severity: normal

Merged with 40240

Found in versions 26.1, 26.3

Fixed in version 27.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 37530 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Axel Svensson <mail <at> axelsvensson.com>, 37530 <at> debbugs.gnu.org
Subject: Re: bug#37530: 26.1; Tack characters translated incorrectly
Date: Fri, 27 Sep 2019 15:03:19 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Isn't the output of "C-h l" evidence that Emacs actually received the
> codepoints it displayed?  IOW, how do we know this is a problem in
> Emacs and not in the keyboard configuration and/or driver software?

I've always wondered how Emacs actually does this thing, but have never
had a peek, so I rummaged around in keyboard.c for a bit.  If I'm
reading the code right, we get an event, and then pick out the
symbol_num from that (and that's probably they keycode in X parlance),
and then we end up here (under X):

/* Convert a keysym to its name.  */

char *
get_keysym_name (int keysym)
{
  char *value;

  block_input ();
  value = XKeysymToString (keysym);
  unblock_input ();

  return value;
}

But I'm a bit lost in how that name is translated into a character.
Uhm...  OK, there's a hash table called x-keysym-table.

(format "%x" (gethash #x0bc2 x-keysym-table))
=> "22a5"

> > #define XKB_KEY_downtack                      0x0bc2  /* U+22A4 DOWN TACK */
> > #define XKB_KEY_uptack                        0x0bce  /* U+22A5 UP TACK */
> > #define XKB_KEY_lefttack                      0x0bdc  /* U+22A3 LEFT TACK */
> > #define XKB_KEY_righttack 0x0bfc /* U+22A2 RIGHT TACK */

And that's wrong, according to the bug reporter.  Now where does that
come from?  Some grepping shows w-win.el:

;; Table from Kuhn's proposed additions to the `KEYSYM Encoding'
;; appendix to the X protocol definition.
(dolist
...
	(#xbc2 . ?⊥)

Oh, there it is.

Character code properties: customize what to show
  name: UP TACK
  general-category: Sm (Symbol, Math)
  decomposition: (8869) ('⊥')

So we've got some wrong data in x-win.el?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 5 years and 141 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.