From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Axel Svensson Newsgroups: gmane.emacs.bugs Subject: bug#37530: 26.1; Tack characters translated incorrectly Date: Fri, 27 Sep 2019 12:37:29 +0200 Message-ID: References: <83zhiqjom4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="113640"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37530@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 27 15:51:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iDqeM-000TFH-4V for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Sep 2019 15:51:10 +0200 Original-Received: from localhost ([::1]:50978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDqeK-000528-7M for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Sep 2019 09:51:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33229) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDq6x-0006ls-Oh for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2019 09:16:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDq6u-0007c2-T9 for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2019 09:16:39 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37167) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDq6u-0007TM-Nj for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2019 09:16:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iDndR-00079t-On for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2019 06:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Axel Svensson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Sep 2019 10:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37530 X-GNU-PR-Package: emacs Original-Received: via spool by 37530-submit@debbugs.gnu.org id=B37530.156958067227501 (code B ref 37530); Fri, 27 Sep 2019 10:38:01 +0000 Original-Received: (at 37530) by debbugs.gnu.org; 27 Sep 2019 10:37:52 +0000 Original-Received: from localhost ([127.0.0.1]:45892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDndH-00079U-Kj for submit@debbugs.gnu.org; Fri, 27 Sep 2019 06:37:52 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:40777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDndD-00079G-KI for 37530@debbugs.gnu.org; Fri, 27 Sep 2019 06:37:50 -0400 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 271A322347 for <37530@debbugs.gnu.org>; Fri, 27 Sep 2019 06:37:42 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Fri, 27 Sep 2019 06:37:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=l/LXLkWn+Ag9LRyYut2zybuThlbCJ+1x1JCbG+eSL zo=; b=vVHf1GPHmOpolTRB1zbvd9ZawwA9OaaiA1OxVv7kwOMjVW2XQyLSRZNms sX3AptkWW0AUbf5pT2JnxPq4UIR7/u+R2UnuhsSnBfszVRX0Y8LtxwRVRuGxKXmD L0Uor6WaRBCUhoici1wJDVbhfWRicV9Qgk1FXJNH82cnqrigLvXpMqOnblaUcWFN b9YId0f2/RmDGreOh4v/wodXPd8lTM4+D+WggMMr5MHgx3w+oO7llznormEiSfl1 iD67p6hLC9Ocb0JR4PBAHUfoKATAfWd0TOl6DkQTm1MoqY4ssVH4GrtP6d7MXIWn VgfDF9lWtvY5/n2sMBm8rJt/3P9+Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrfeeigddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeggfhgjhfffkffuvfgtgfesthhqredttddtjeenucfhrhhomhepteigvghlucfu vhgvnhhsshhonhcuoehmrghilhesrgigvghlshhvvghnshhsohhnrdgtohhmqeenucfkph epvddtledrkeehrdduieejrddujedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghi lhesrgigvghlshhvvghnshhsohhnrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Original-Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 87968D60062 for <37530@debbugs.gnu.org>; Fri, 27 Sep 2019 06:37:41 -0400 (EDT) Original-Received: by mail-oi1-f171.google.com with SMTP id w17so4771028oiw.8 for <37530@debbugs.gnu.org>; Fri, 27 Sep 2019 03:37:41 -0700 (PDT) X-Gm-Message-State: APjAAAXiW2Z/olQa/lapGe8NfJF5k8t7Scgt26xSuJC4Np0Miq2OW+Wt 0ejmCWaeWB85py1N8LwtYhW6k2oYaKo/VvQGkik= X-Google-Smtp-Source: APXvYqw78Xsige35Wh+g9aBp7qBDTrUqjT/AECRObXxc2njQS40UuGeAxDKhAqkMll91WuylIoX8Y/hPyUbjmH9mFWs= X-Received: by 2002:aca:f3d4:: with SMTP id r203mr6196155oih.164.1569580661048; Fri, 27 Sep 2019 03:37:41 -0700 (PDT) In-Reply-To: <83zhiqjom4.fsf@gnu.org> X-Gmail-Original-Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:167373 Archived-At: On Fri, Sep 27, 2019, 07:27 Eli Zaretskii wrote: > > 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? > > Thanks. Good point. The following tests confirm that the mistranslation is in Emacs, and specifically in its handling of X11 events, and not in the setup: - Install xdotool (On debian, `apt-get install xdotool`) - In order to test an application's tack character interpretation: - In a terminal, run: sleep 3; xdotool \ key --delay 500 uptack \ key --delay 500 downtack \ key --delay 500 lefttack \ key --delay 500 righttack - Quickly switch focus to the application you want to test - Wait 5 seconds - Investigate the effect in the application. If the application is such that it attempts to display characters that are inputted via the keyboard, it should display the string "=E2=8A=A5=E2=8A=A4=E2=8A=A3= =E2=8A=A2". On my setup, the following are the results of using the test above for emacs, compared to a few other applications: - GNU Emacs 26.1 started with -Q: The string "=E2=8A=A4=E2=8A=A5=E2=8A=A2=E2=8A=A3" is displayed, which is = wrong. - Gnome Terminal 3.30.2: The string "=E2=8A=A5=E2=8A=A4=E2=8A=A3=E2=8A=A2" is displayed, as expect= ed. - GNU Emacs 26.1 started with -Q -nw under Gnome Terminal 3.30.2: The string "=E2=8A=A5=E2=8A=A4=E2=8A=A3=E2=8A=A2" is displayed, as expect= ed. - Chromium 73, with focus in the address bar: The string "=E2=8A=A5=E2=8A=A4=E2=8A=A3=E2=8A=A2" is displayed, as expect= ed. - Firefox 60.8.0esr 64-bit, with focus in the address bar: The string "=E2=8A=A5=E2=8A=A4=E2=8A=A3=E2=8A=A2" is displayed, as expect= ed. - xterm: No characters are displayed. - xev (in package xutils, x11-utils, or similar): This application prints debugging information for X11 events. See the output below. It confirms that the setup is sending correct key events. However, XLookupString refuses to translate the keysym to a utf-8 string. I believe this might mean that it is up to the applications to find a way to translate the keysyms, and can explain why some applications do not display any characters. However, it does not explain why emacs displays the wrong characters. =3D=3D=3D=3D=3D Begin relevant part of xev output =3D=3D=3D=3D=3D MappingNotify event, serial 32, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 32, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 32, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 32, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 KeyPress event, serial 36, synthetic NO, window 0x2c00001, root 0x388, subw 0x0, time 141855379, (513,324), root:(516,777), state 0x0, keycode 123 (keysym 0xbce, uptack), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False MappingNotify event, serial 36, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 36, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 36, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 36, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 36, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 36, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 36, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 36, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 KeyRelease event, serial 36, synthetic NO, window 0x2c00001, root 0x388, subw 0x0, time 141855632, (513,324), root:(516,777), state 0x0, keycode 123 (keysym 0xbce, uptack), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False MappingNotify event, serial 44, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 44, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 44, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 44, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 44, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 44, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 44, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 44, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 KeyPress event, serial 44, synthetic NO, window 0x2c00001, root 0x388, subw 0x0, time 141855885, (513,324), root:(516,777), state 0x0, keycode 123 (keysym 0xbc2, downtack), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False MappingNotify event, serial 52, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 52, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 52, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 52, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 52, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 52, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 52, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 52, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 KeyRelease event, serial 52, synthetic NO, window 0x2c00001, root 0x388, subw 0x0, time 141856137, (513,324), root:(516,777), state 0x0, keycode 123 (keysym 0xbc2, downtack), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False MappingNotify event, serial 60, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 60, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 60, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 60, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 60, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 60, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 60, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 60, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 KeyPress event, serial 60, synthetic NO, window 0x2c00001, root 0x388, subw 0x0, time 141856392, (513,324), root:(516,777), state 0x0, keycode 123 (keysym 0xbdc, lefttack), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False MappingNotify event, serial 68, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 68, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 68, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 68, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 68, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 68, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 68, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 68, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 KeyRelease event, serial 68, synthetic NO, window 0x2c00001, root 0x388, subw 0x0, time 141856643, (513,324), root:(516,777), state 0x0, keycode 123 (keysym 0xbdc, lefttack), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False MappingNotify event, serial 76, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 76, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 76, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 76, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 76, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 76, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 76, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 76, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 KeyPress event, serial 76, synthetic NO, window 0x2c00001, root 0x388, subw 0x0, time 141856898, (513,324), root:(516,777), state 0x0, keycode 123 (keysym 0xbfc, righttack), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False MappingNotify event, serial 84, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 84, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 84, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 84, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 84, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 84, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 84, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 84, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 KeyRelease event, serial 92, synthetic NO, window 0x2c00001, root 0x388, subw 0x0, time 141857162, (513,324), root:(516,777), state 0x0, keycode 123 (keysym 0xbfc, righttack), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False MappingNotify event, serial 92, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 92, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 92, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 MappingNotify event, serial 92, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 123, count 1 FocusOut event, serial 96, synthetic NO, window 0x2c00001, mode NotifyGrab, detail NotifyNonlinear =3D=3D=3D=3D=3D End relevant part of xev output =3D=3D=3D=3D=3D