GNU bug report logs - #43830
keyboard layout handling incompatible with rest of the OS

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Paul Pogonyshev <pogonyshev@HIDDEN>; merged with #45347, #49379; dated Tue, 6 Oct 2020 15:35:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Merged 43830 45347 49379. Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Forcibly Merged 43830 45347. Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 2 Nov 2020 15:38:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 02 10:38:53 2020
Received: from localhost ([127.0.0.1]:42193 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZbv3-0003DE-JY
	for submit <at> debbugs.gnu.org; Mon, 02 Nov 2020 10:38:53 -0500
Received: from eggs.gnu.org ([209.51.188.92]:56612)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kZbv2-0003D2-0L
 for 43830 <at> debbugs.gnu.org; Mon, 02 Nov 2020 10:38:52 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:48415)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kZbuv-0001nS-6L; Mon, 02 Nov 2020 10:38:45 -0500
Received: from [176.228.60.248] (port=1296 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kZbui-0000WW-LE; Mon, 02 Nov 2020 10:38:36 -0500
Date: Mon, 02 Nov 2020 17:38:22 +0200
Message-Id: <83d00vepld.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Arthur Miller <arthur.miller@HIDDEN>
In-Reply-To: <VI1PR06MB4526B8451AD5287CFBC7522196100@HIDDEN>
 (message from Arthur Miller on Mon, 02 Nov 2020 05:41:06 +0100)
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 <87blghbjpn.fsf@HIDDEN>
 <CAG7Bpaq7PF8AmEwxHhec2J+uzj9GVq9NwHoU90aLWym9Fe3miw@HIDDEN>
 <83blghf0rf.fsf@HIDDEN>
 <CAG7BpapOXz6Utm1pbtaF-At7P9pFDY20uCdvDQY_6vwFcCZKNA@HIDDEN>
 <83v9eoeuud.fsf@HIDDEN> 
 <VI1PR06MB4526B8451AD5287CFBC7522196100@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, pogonyshev@HIDDEN, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Arthur Miller <arthur.miller@HIDDEN>
> Cc: Paul Pogonyshev <pogonyshev@HIDDEN>,  43830 <at> debbugs.gnu.org,
>   juri@HIDDEN
> Date: Mon, 02 Nov 2020 05:41:06 +0100
> 
> > Nothing else makes sense to me, because exposing this info to Lisp
> > means every Lisp program which deals with input will have to decide
> > what to do with such events.
> 
> Couldn't Emacs just pack scancodes into some event structure

That's what I was prfoposing to do, on the C level.

> Would it be possible to use scancodes for the shortcuts internally in
> the interpreter itself?

I don't think I understand what shortcuts you have in mind here.

> Shortcuts could be specified by users and scripts as they are now
> (as keys/characters); but when Emacs starts, it could populate a lookup
> table based on the current layout with scancodes, and then translate
> shortcuts from keys to scancodes for internal usage. If user chagnes
> keyboard layout on the fly, new lookup table would be generated, because
> virtual keys would change but scancodes would stay same; so it wouldn't
> matter if some key jumps from one physical key to another. That wouldn't
> require to expose scancodes to Lisp either. But that would mean that
> routines for inserting text in buffers would have to work differently
> from shortcut handling routines, with regard to input; I don't know if
> that is case now or if it is possible.
> 
> Is something like that possible to implement in current Emacs? Woukd it
> be too much work?

I think you are forgetting how many different methods are there on a
modern system to generate keyboard input.  There are system input
methods, there are virtual keyboards, etc. etc.  And I don't think we
can easily read keyboard on scancode level, either, even if we wanted
to.  But I'm not an expert.

> I don't know if it is possible to automatically detect keyboard layout
> change in all cases.

AFAIK, we only support that on MS-Windows.

> I know that Emacs automatically switches to different layout when I
> change keyboard with loadkeys or in vconsole.conf.

That's because we read characters, and those don't change.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 2 Nov 2020 04:41:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 23:41:21 2020
Received: from localhost ([127.0.0.1]:39224 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZRej-0002hi-Cy
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 23:41:21 -0500
Received: from mail-db8eur05olkn2082.outbound.protection.outlook.com
 ([40.92.89.82]:41616 helo=EUR05-DB8-obe.outbound.protection.outlook.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arthur.miller@HIDDEN>) id 1kZRee-0002hS-Rz
 for 43830 <at> debbugs.gnu.org; Sun, 01 Nov 2020 23:41:20 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=eihOk3B4aqHIUprvFIoHy3yqVirFQrMKXIq1O/1qMVZbQkRqNtWOsNk/rJwHPfxmDXyznksh2GjdGh+tOC6xwzuPCBCvwRgm3lQO9UimH8Juk220I20Fi1zN2C0u329RvdC/qA/t008vCUEEE6/akrSVyNFoxtOHYB5Dr6jAJnVPcU+lMj8qUvSec6lQ8wlbyAP8gvqlthGOMB33TlCqen9t7V9cxiuA6t+B9f1+CsXe/6bxf1y9naOvQMA/7lNTGlFN7WBbZPQf3vHpsZsZWvQXu/jFvBfWWb27WCTxf7R7ur91geN9YUPqBgjobrIA/SvJYayin961m2kBxWHEFQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eEyH7ivz7Cpcz/20f6ooflzKAnttBLtQp9Z1qF76GFg=;
 b=VA9gKy7DtMdUlUrd7rkyuHv/zhr1Kv+jKBuRCr/H+SVQW7q+RcfnsHsd5KOULqdWNK0Zo9Rie1Wq8mOSmtWoji3FTmkn5QW2DzTevnv1Sl6qEJ8hd5skx+0epNybzQkPTnaNlsEXRoW1MewE9jdjoHnl/d1KyQBcg+5R13uxAm+fHrMfxhjfy4aRmSwYN5bPIpAHATDET+OjWBvC1sHL9WsHXt1QRkRkRe+DTozJXNgivGX5kEv9xHHgfB8UeQ4cXtnPQ6Y1EZevDqMj1+SwouwVaK3+kh8BRqF172WqXONb0bI2zl9HQR/MTuQthqj5VoKZ+FnU69Qnvn+F46+56Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; 
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eEyH7ivz7Cpcz/20f6ooflzKAnttBLtQp9Z1qF76GFg=;
 b=umonql7nze+VU0Lpz0s/iT6P+vjXHMppXORYUaMj2nD4Vy4ew/+i8rl0MELp6dbPDZuKnBnwywbqh+OOtw1nk80Ud3gk3zMFhCGScjoHRXODGl2wEry0wZvCsuoawZnMR8bnt0Fjy1P6OzndSVNVb8VARczXMhZJ3bwiId3ax1VWo2JJsJk1gFURpR6SlUFgV4EtB1y00EX9L4amvmi0yV7jtoNCx8khuonmbpngHWsPatfMPwHVP3u+W9tD+uqRQ2CqXvxrGTr2eC7reQdF9rroOttyf2vsAhZoKby/QfsqitEhoKzxUljhH+PmKv1xMxT0ArL/+BQ55dX+Uajzkg==
Received: from DB8EUR05FT052.eop-eur05.prod.protection.outlook.com
 (2a01:111:e400:fc0f::52) by
 DB8EUR05HT123.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::467)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.15; Mon, 2 Nov
 2020 04:41:10 +0000
Received: from VI1PR06MB4526.eurprd06.prod.outlook.com
 (2a01:111:e400:fc0f::46) by DB8EUR05FT052.mail.protection.outlook.com
 (2a01:111:e400:fc0f::222) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.15 via Frontend
 Transport; Mon, 2 Nov 2020 04:41:10 +0000
X-IncomingTopHeaderMarker: OriginalChecksum:B9497FFC06798C0121466185A29FB40861E5F8DCE92D2ECDB5289955F99A9DBD;
 UpperCasedChecksum:D026C29A19E4B8C57F2B37F894C1F08F6C1571DDFEB44E6D016217E05230A6A8;
 SizeAsReceived:8305; Count:46
Received: from VI1PR06MB4526.eurprd06.prod.outlook.com
 ([fe80::187b:196a:cb2d:adf1]) by VI1PR06MB4526.eurprd06.prod.outlook.com
 ([fe80::187b:196a:cb2d:adf1%5]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020
 04:41:10 +0000
From: Arthur Miller <arthur.miller@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 <87blghbjpn.fsf@HIDDEN>
 <CAG7Bpaq7PF8AmEwxHhec2J+uzj9GVq9NwHoU90aLWym9Fe3miw@HIDDEN>
 <83blghf0rf.fsf@HIDDEN>
 <CAG7BpapOXz6Utm1pbtaF-At7P9pFDY20uCdvDQY_6vwFcCZKNA@HIDDEN>
 <83v9eoeuud.fsf@HIDDEN>
Date: Mon, 02 Nov 2020 05:41:06 +0100
In-Reply-To: <83v9eoeuud.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 01 Nov
 2020 21:32:42 +0200")
Message-ID: <VI1PR06MB4526B8451AD5287CFBC7522196100@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Content-Type: text/plain
X-TMN: [PTPpP4bpa5nRtNwtispdk11ChcHQnSR1]
X-ClientProxiedBy: AM6PR08CA0016.eurprd08.prod.outlook.com
 (2603:10a6:20b:b2::28) To VI1PR06MB4526.eurprd06.prod.outlook.com
 (2603:10a6:803:ac::17)
X-Microsoft-Original-Message-ID: <87361sfk0t.fsf@HIDDEN>
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
Received: from pascal.homepc (90.230.29.56) by
 AM6PR08CA0016.eurprd08.prod.outlook.com (2603:10a6:20b:b2::28) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.3499.18 via Frontend Transport; Mon, 2 Nov 2020 04:41:07 +0000
X-MS-PublicTrafficType: Email
X-IncomingHeaderCount: 46
X-EOPAttributedMessage: 0
X-MS-Office365-Filtering-Correlation-Id: bca3b7d9-8a08-4f77-a2d6-08d87ee98407
X-MS-TrafficTypeDiagnostic: DB8EUR05HT123:
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: FSiBtmetpvYsXRXLqbBEeuuE9mUJ2RV22WThkniE89y152IxhhEommvN+l0zMf9o8Pf1LWkg8Y5wNjCJ27jEfOShdqmhg9ASmLNRtDTB3fItDu57+bqzv4+zNHqhN6dfGRWSpq7CaS0jY50gNX8PIHezK35uWdKXkhXj1qxppLNEt7C0pHi2ztuIBUJA8GciM3yybuA4+qoaC7NLtLlI7g==
X-MS-Exchange-AntiSpam-MessageData: 8yMVoHfpueuYQtl/xJjMIiWgccd5YgGVa0bUOKAWJ0Y0Ta5FVrD9kfkQd73gGM1FvUj52Tn28s6Tuia6wDyysV8cp6sKWjzIRadvKpFNdc4lZa8VPdBlA+Fh2f3nf6HBvigmDOLVKyTGzCYdFqHd/Q==
X-OriginatorOrg: live.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bca3b7d9-8a08-4f77-a2d6-08d87ee98407
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 04:41:10.2595 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT052.eop-eur05.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: Internet
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR05HT123
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, Paul Pogonyshev <pogonyshev@HIDDEN>,
 juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Paul Pogonyshev <pogonyshev@HIDDEN>
>> Date: Sun, 1 Nov 2020 19:56:09 +0100
>> Cc: Juri Linkov <juri@HIDDEN>, 43830 <at> debbugs.gnu.org
>> 
>> > read-event will figure out by itself whether it should return the
>> > ASCII character or a non-ASCII character, and return that.
>> 
>> I'm not sure that is possible, because it doesn't really know how it
>> is going to be processed.
>
> It knows the binding of the character, and it knows other things.
>
> Nothing else makes sense to me, because exposing this info to Lisp
> means every Lisp program which deals with input will have to decide
> what to do with such events.

Couldn't Emacs just pack scancodes into some event structure similar as
raw_input in windows does? But I don't think Elisp programs really would
have use of scancodes anyway.

Would it be possible to use scancodes for the shortcuts internally in
the interpreter itself?

Shortcuts could be specified by users and scripts as they are now
(as keys/characters); but when Emacs starts, it could populate a lookup
table based on the current layout with scancodes, and then translate
shortcuts from keys to scancodes for internal usage. If user chagnes
keyboard layout on the fly, new lookup table would be generated, because
virtual keys would change but scancodes would stay same; so it wouldn't
matter if some key jumps from one physical key to another. That wouldn't
require to expose scancodes to Lisp either. But that would mean that
routines for inserting text in buffers would have to work differently
from shortcut handling routines, with regard to input; I don't know if
that is case now or if it is possible.

Is something like that possible to implement in current Emacs? Woukd it
be too much work?

I don't know if it is possible to automatically detect keyboard layout
change in all cases. I know that Emacs automatically switches to
different layout when I change keyboard with loadkeys or in vconsole.conf.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 20:07:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 15:07:10 2020
Received: from localhost ([127.0.0.1]:38659 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZJd7-0002fG-VY
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 15:07:10 -0500
Received: from mail-wm1-f51.google.com ([209.85.128.51]:54112)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kZJd6-0002f1-1F
 for 43830 <at> debbugs.gnu.org; Sun, 01 Nov 2020 15:07:08 -0500
Received: by mail-wm1-f51.google.com with SMTP id p22so7464518wmg.3
 for <43830 <at> debbugs.gnu.org>; Sun, 01 Nov 2020 12:07:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=7PDLVJWJwvLrwfmKZw+n93ZjsWj5RspN5aikLjksBOg=;
 b=iR+qfLaaUWIXLOoY4llOGqghS1OGQlfffYFZED5CTClBCOTyFuZOUaiZvoioKlTfRQ
 42rOv9NXipUH2mRvmowrYIhNzGVHVfDoTK+pcrsJjH9rShVXjEkJ3yjWnwPuSjAazT75
 uTqeHnp8aDBoPatvE1bI+T7YMtwTR6WDel6mACLNdCQL+PVtQCjQozHflBsxh61yi8YU
 WHB8w6CBAoV3TcsWrH9Y76m1EMkfNF5fdBsysRYTixKzZuRpFqLPjiBXDIQBhNvMzh9/
 dVkrbMDhBk/ezwxTqfJkqDn//NOW6XyEbKPnbULJ7CiIm37kAHITl+D2hXRDTK4P566S
 3PAg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=7PDLVJWJwvLrwfmKZw+n93ZjsWj5RspN5aikLjksBOg=;
 b=tXUMDU0R9dYmZJDUp29lZHmyAUElJ6Qz1St9bcannQ4k/zke+ezTXu6YSlNBDJflSN
 CkNHEuCcdL3YwcW03DaTjRtg3YMsQ2H3kMRrfETviPX1jWUwjHzH5oaDCm3DgOa53n6g
 24/ve+++s/TlMlV7zFPOTEx5lrIbm/mOzZ9bU5Ib6xj5aXO7mjld2Xcd/78jS8ZMGMhp
 xpfA/qBn2O8M3epQ6I/zYUhziSNPN4tZbOELmEXw4fQVZPhPy7RODvChnUH0vmQ3q2Ck
 0cTox0GGoayv33h/YCATFYuzkncIJIz0k6ltkS5ziQQ/0JIbhZSb8m+iGZDfif8fVwNv
 mFJw==
X-Gm-Message-State: AOAM530cTcSyKA1Lv0iET/ozIUYtjLRnrSRA4LoXXc4I6xARt/A/jKVK
 3N2mTaADfnqvb4mTG4Q4qHAVzxKIdFE3O3XKMA==
X-Google-Smtp-Source: ABdhPJzHcyQ7uC+8uQEHfmb7v3sQ+5vH1qatz/VUn113xqC5g9Caw6Fx/1vg/VX3wj8/6VvIE3zXwdfu2gHFKVjsaQM=
X-Received: by 2002:a05:600c:2049:: with SMTP id
 p9mr13178604wmg.147.1604261222176; 
 Sun, 01 Nov 2020 12:07:02 -0800 (PST)
MIME-Version: 1.0
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 <87blghbjpn.fsf@HIDDEN>
 <CAG7Bpaq7PF8AmEwxHhec2J+uzj9GVq9NwHoU90aLWym9Fe3miw@HIDDEN>
 <83blghf0rf.fsf@HIDDEN>
 <CAG7BpapOXz6Utm1pbtaF-At7P9pFDY20uCdvDQY_6vwFcCZKNA@HIDDEN>
 <83v9eoeuud.fsf@HIDDEN>
In-Reply-To: <83v9eoeuud.fsf@HIDDEN>
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Sun, 1 Nov 2020 21:06:50 +0100
Message-ID: <CAG7Bpap_NYDyeHbhurLKJ5TTa=W0=eqABKhRFT1d3zayv=TDVw@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000465cf705b3112c6e"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000465cf705b3112c6e
Content-Type: text/plain; charset="UTF-8"

> It knows the binding of the character, and it knows other things.

When it knows the bindings (99% of cases) it is called internally by
the command loop, so it doesn't even go into Elisp domain here.
If something calls `read-event' or similar on the Elisp level,
presumably they don't use keymaps for whatever reasons and
process events specially. In this case `read-event' cannot possibly
know what The Right Thing is.

> Nothing else makes sense to me, because exposing this info to Lisp
> means every Lisp program which deals with input will have to decide
> what to do with such events.

As I understand it, 99% of handling is done by the main command
loop at the C level, so it is not a problem to do it once there. I still
would give Elisp access so that special users of `read-event' etc. can
follow suit, but this would not oblige them to do anything. Programs
and modes that don't do anything special (either because they are
old or do not care) will just behave as now, with no effective changes.

Paul

On Sun, 1 Nov 2020 at 20:33, Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Paul Pogonyshev <pogonyshev@HIDDEN>
> > Date: Sun, 1 Nov 2020 19:56:09 +0100
> > Cc: Juri Linkov <juri@HIDDEN>, 43830 <at> debbugs.gnu.org
> >
> > > read-event will figure out by itself whether it should return the
> > > ASCII character or a non-ASCII character, and return that.
> >
> > I'm not sure that is possible, because it doesn't really know how it
> > is going to be processed.
>
> It knows the binding of the character, and it knows other things.
>
> Nothing else makes sense to me, because exposing this info to Lisp
> means every Lisp program which deals with input will have to decide
> what to do with such events.
>

--000000000000465cf705b3112c6e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; It knows the binding of the character, and it knows o=
ther things.<div><br></div><div>When it knows the bindings (99% of cases) i=
t is called internally by</div><div>the command loop, so it doesn&#39;t eve=
n go into Elisp domain here.</div><div>If something calls `read-event&#39; =
or similar on the Elisp level,</div><div>presumably they don&#39;t use keym=
aps for whatever reasons and</div><div>process events specially. In this ca=
se `read-event&#39; cannot possibly</div><div>know what The Right Thing is.=
<br><br>&gt; Nothing else makes sense to me, because exposing this info to =
Lisp<br>&gt; means every Lisp program which deals with input will have to d=
ecide<br>&gt; what to do with such events.<br></div><div><br></div><div>As =
I understand it, 99% of handling is done by the main command</div><div>loop=
 at the C level, so it is not a problem to do it once there. I still</div><=
div>would give Elisp access so that special users of `read-event&#39; etc. =
can</div><div>follow suit, but this would not oblige them to do anything. P=
rograms</div><div>and modes that don&#39;t do anything special (either beca=
use they are</div><div>old or do not care) will just behave as now, with no=
 effective changes.</div><div><br></div><div>Paul</div></div><br><div class=
=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, 1 Nov 2020 a=
t 20:33, Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>=
&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt;=
 From: Paul Pogonyshev &lt;<a href=3D"mailto:pogonyshev@HIDDEN" target=
=3D"_blank">pogonyshev@HIDDEN</a>&gt;<br>
&gt; Date: Sun, 1 Nov 2020 19:56:09 +0100<br>
&gt; Cc: Juri Linkov &lt;<a href=3D"mailto:juri@HIDDEN" target=3D"_blan=
k">juri@HIDDEN</a>&gt;, <a href=3D"mailto:43830 <at> debbugs.gnu.org" target=
=3D"_blank">43830 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; &gt; read-event will figure out by itself whether it should return the=
<br>
&gt; &gt; ASCII character or a non-ASCII character, and return that.<br>
&gt; <br>
&gt; I&#39;m not sure that is possible, because it doesn&#39;t really know =
how it<br>
&gt; is going to be processed.<br>
<br>
It knows the binding of the character, and it knows other things.<br>
<br>
Nothing else makes sense to me, because exposing this info to Lisp<br>
means every Lisp program which deals with input will have to decide<br>
what to do with such events.<br>
</blockquote></div>

--000000000000465cf705b3112c6e--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 19:33:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 14:33:09 2020
Received: from localhost ([127.0.0.1]:38568 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZJ6C-0001is-Qv
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 14:33:09 -0500
Received: from eggs.gnu.org ([209.51.188.92]:44322)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kZJ6A-0001iN-5J
 for 43830 <at> debbugs.gnu.org; Sun, 01 Nov 2020 14:33:07 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:59711)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kZJ64-0002uB-Ik; Sun, 01 Nov 2020 14:33:00 -0500
Received: from [176.228.60.248] (port=2778 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kZJ5x-0000LP-53; Sun, 01 Nov 2020 14:32:54 -0500
Date: Sun, 01 Nov 2020 21:32:42 +0200
Message-Id: <83v9eoeuud.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
In-Reply-To: <CAG7BpapOXz6Utm1pbtaF-At7P9pFDY20uCdvDQY_6vwFcCZKNA@HIDDEN>
 (message from Paul Pogonyshev on Sun, 1 Nov 2020 19:56:09 +0100)
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 <87blghbjpn.fsf@HIDDEN>
 <CAG7Bpaq7PF8AmEwxHhec2J+uzj9GVq9NwHoU90aLWym9Fe3miw@HIDDEN>
 <83blghf0rf.fsf@HIDDEN>
 <CAG7BpapOXz6Utm1pbtaF-At7P9pFDY20uCdvDQY_6vwFcCZKNA@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Paul Pogonyshev <pogonyshev@HIDDEN>
> Date: Sun, 1 Nov 2020 19:56:09 +0100
> Cc: Juri Linkov <juri@HIDDEN>, 43830 <at> debbugs.gnu.org
> 
> > read-event will figure out by itself whether it should return the
> > ASCII character or a non-ASCII character, and return that.
> 
> I'm not sure that is possible, because it doesn't really know how it
> is going to be processed.

It knows the binding of the character, and it knows other things.

Nothing else makes sense to me, because exposing this info to Lisp
means every Lisp program which deals with input will have to decide
what to do with such events.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 18:56:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 13:56:29 2020
Received: from localhost ([127.0.0.1]:38509 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZIWi-0000nK-SV
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 13:56:29 -0500
Received: from mail-wr1-f41.google.com ([209.85.221.41]:45307)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kZIWh-0000n7-60
 for 43830 <at> debbugs.gnu.org; Sun, 01 Nov 2020 13:56:27 -0500
Received: by mail-wr1-f41.google.com with SMTP id a9so12054164wrg.12
 for <43830 <at> debbugs.gnu.org>; Sun, 01 Nov 2020 10:56:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=51Ks0D1Fxmg+lkck9pSM56tNPB45CVtc7HPtSFKbRQ8=;
 b=G2nUj447wdyo7K/c/Lh83E1r8HwrpWGezy6UeVZOTCDgzSZ1kTsgmaMXJLz7JBBTY2
 FA8lX8H7yd7MgGj+awhIaMScpCwcDSB7wJEcUeEbDlW+v6aM5xBBthPEttkpNGrbSvDf
 f0ZPle7kTkUZ5V9cxtk7+xRq22lXYXE1kvSfU0e+yiCsVAN5AvAAaD5wbqZzCg0z7bBP
 E/8D0O2TI5v1ICJM5Z/2uYKESdQiFI4THzs2ZgVNAanvsXq7twO0dR5zgP/1Phm+oQ3F
 HDjPQzassecM71PeKINM+/Gd/T8OnU/9itPx1NdulAnoYu+SwCX5fETzXPQWxShiVuE+
 UdHg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=51Ks0D1Fxmg+lkck9pSM56tNPB45CVtc7HPtSFKbRQ8=;
 b=bMEzyfjG2PhQaUqAcr54hHEejtbaU2+GPCdSxHfA7ovOmDJoTEoRFgYabs5SATw+e9
 yj4gDQXqTu5Hf4U9IX4jheNpcmesLlDTZZ3xDyihFmZfUA2X4f0UAiZLrDqsrIri2Zkr
 frSv3snf01ZlTMAPVgQEY5FxLNibCoOvz7Q064E9LlvLjMO7QM6/xHW+bJ9PNUG83gg8
 rFD4FKl2vS5SXomddiVmKRH+EB/YxycwzErvzgtnvnIuShd/A0djmnukrRtqpAfT3asg
 LNil1Ef+MepNw6BNjhfzG+U4iOfBxHWRayXceEQsbbYKiBIYjmE6NRx/gKG63f5VhILS
 hJ3Q==
X-Gm-Message-State: AOAM532hczXsI29SGhE16N3atCl+vQyXDWf4RFmPNo8xLgJV4bybO8tS
 WdVI0Pj9tzNm90sijlXFd04E1rUBMBEp5q20iw==
X-Google-Smtp-Source: ABdhPJy2OHSzLU4viKGQRFRUkt3ohSG+sMW+8dcRv0vaAfzzdaEW3JFeewTua53+P6b78EI0jT755YqMLREmjAWaTP4=
X-Received: by 2002:a5d:568a:: with SMTP id f10mr15748141wrv.30.1604256981218; 
 Sun, 01 Nov 2020 10:56:21 -0800 (PST)
MIME-Version: 1.0
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 <87blghbjpn.fsf@HIDDEN>
 <CAG7Bpaq7PF8AmEwxHhec2J+uzj9GVq9NwHoU90aLWym9Fe3miw@HIDDEN>
 <83blghf0rf.fsf@HIDDEN>
In-Reply-To: <83blghf0rf.fsf@HIDDEN>
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Sun, 1 Nov 2020 19:56:09 +0100
Message-ID: <CAG7BpapOXz6Utm1pbtaF-At7P9pFDY20uCdvDQY_6vwFcCZKNA@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000007e785505b3102fe0"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000007e785505b3102fe0
Content-Type: text/plain; charset="UTF-8"

> read-event will figure out by itself whether it should return the
> ASCII character or a non-ASCII character, and return that.

I'm not sure that is possible, because it doesn't really know how it
is going to be processed. But you must be much more familiar with
Emacs internals.

Paul

On Sun, 1 Nov 2020 at 18:25, Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Paul Pogonyshev <pogonyshev@HIDDEN>
> > Date: Sun, 1 Nov 2020 17:51:00 +0100
> > Cc: Eli Zaretskii <eliz@HIDDEN>, 43830 <at> debbugs.gnu.org
> >
> > > > What about functions like `read-event'? It returns integers if I
> press
> > > > M-[letter] or C-[letter].
> > >
> > > read-event is also implemented in C.  But maybe I don't understand
> > > your question.
> >
> > I mean, what about the cases where it is called from Elisp?  It is
> > implemented in C, but also is publicly available.
> >
> > I have come up with two ideas:
> >
> > 1. `read-event' and its internal C implementation grow an optional
> > parameter that says whether to return character as if being typed (as
> > now) or for keybinding use (i.e. from physical keys).
> >
> > 2. Alternatively, if this cannot be determined in advance (i.e. before
> > calling `read-event' etc.), these functions could set variable named sth.
> > like `last-keybinding-keycode'. Then the caller would use either the
> > return value (as now) or, if it wants, the value of the variable instead.
>
> What I had in mind was
>
>  0. read-event will figure out by itself whether it should return the
>  ASCII character or a non-ASCII character, and return that.
>

--0000000000007e785505b3102fe0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; read-event will figure out by itself whether it shoul=
d return the<br>&gt; ASCII character or a non-ASCII character, and return t=
hat.<br><div><br></div><div>I&#39;m not sure that is possible, because it d=
oesn&#39;t really know how it</div><div>is going to be processed. But you m=
ust be much more familiar with</div><div>Emacs internals.</div><div><br></d=
iv><div>Paul</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cla=
ss=3D"gmail_attr">On Sun, 1 Nov 2020 at 18:25, Eli Zaretskii &lt;<a href=3D=
"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid r=
gb(204,204,204);padding-left:1ex">&gt; From: Paul Pogonyshev &lt;<a href=3D=
"mailto:pogonyshev@HIDDEN" target=3D"_blank">pogonyshev@HIDDEN</a>&gt=
;<br>
&gt; Date: Sun, 1 Nov 2020 17:51:00 +0100<br>
&gt; Cc: Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN" target=3D"_blank=
">eliz@HIDDEN</a>&gt;, <a href=3D"mailto:43830 <at> debbugs.gnu.org" target=3D"=
_blank">43830 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; &gt; &gt; What about functions like `read-event&#39;? It returns integ=
ers if I press<br>
&gt; &gt; &gt; M-[letter] or C-[letter].<br>
&gt; &gt; <br>
&gt; &gt; read-event is also implemented in C.=C2=A0 But maybe I don&#39;t =
understand<br>
&gt; &gt; your question.<br>
&gt; <br>
&gt; I mean, what about the cases where it is called from Elisp?=C2=A0 It i=
s<br>
&gt; implemented in C, but also is publicly available.<br>
&gt; <br>
&gt; I have come up with two ideas:<br>
&gt; <br>
&gt; 1. `read-event&#39; and its internal C implementation grow an optional=
<br>
&gt; parameter that says whether to return character as if being typed (as<=
br>
&gt; now) or for keybinding use (i.e. from physical keys).<br>
&gt; <br>
&gt; 2. Alternatively, if this cannot be determined in advance (i.e. before=
<br>
&gt; calling `read-event&#39; etc.), these functions could set variable nam=
ed sth.<br>
&gt; like `last-keybinding-keycode&#39;. Then the caller would use either t=
he<br>
&gt; return value (as now) or, if it wants, the value of the variable inste=
ad.<br>
<br>
What I had in mind was<br>
<br>
=C2=A00. read-event will figure out by itself whether it should return the<=
br>
=C2=A0ASCII character or a non-ASCII character, and return that.<br>
</blockquote></div>

--0000000000007e785505b3102fe0--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 18:49:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 13:49:24 2020
Received: from localhost ([127.0.0.1]:38493 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZIPs-0000cK-ER
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 13:49:24 -0500
Received: from eggs.gnu.org ([209.51.188.92]:36248)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kZIPq-0000c2-0P
 for 43830 <at> debbugs.gnu.org; Sun, 01 Nov 2020 13:49:23 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:59026)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kZIPk-0005Ta-7o; Sun, 01 Nov 2020 13:49:16 -0500
Received: from [176.228.60.248] (port=3875 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kZIPj-0006x8-2k; Sun, 01 Nov 2020 13:49:15 -0500
Date: Sun, 01 Nov 2020 20:49:03 +0200
Message-Id: <83361sgbfk.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87v9ep54sy.fsf@HIDDEN> (message from Juri Linkov on
 Sun, 01 Nov 2020 20:27:41 +0200)
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 <87blghbjpn.fsf@HIDDEN> <83y2jlf6wx.fsf@HIDDEN>
 <87v9ep54sy.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, pogonyshev@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Juri Linkov <juri@HIDDEN>
> Cc: pogonyshev@HIDDEN,  43830 <at> debbugs.gnu.org
> Date: Sun, 01 Nov 2020 20:27:41 +0200
> 
> > Why do you want XkbTranslateKeyCode to do this? why not the code in
> > keyboard.c that reads the event queue and invokes commands?  If we
> > make both the key and the character available to keyboard.c, it should
> > be able to figure out what is TRT in each situation, I think.
> 
> Actually by the phrase "code for XkbTranslateKeyCode" I meant the code
> in keyboard.c that could use XkbTranslateKeyCode to do the key translation
> between physical keys and characters.

If we keep both the translated and the untranslated character in the
queue, we won't need to call XkbTranslateKeyCode from keyboard.c,
because we'd already have the information.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 18:40:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 13:40:47 2020
Received: from localhost ([127.0.0.1]:38472 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZIHX-0000NT-F3
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 13:40:47 -0500
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:39477)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kZIHV-0000My-Mv
 for 43830 <at> debbugs.gnu.org; Sun, 01 Nov 2020 13:40:45 -0500
X-Originating-IP: 91.129.102.160
Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160])
 (Authenticated sender: juri@HIDDEN)
 by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 5F18820006;
 Sun,  1 Nov 2020 18:40:37 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
Organization: LINKOV.NET
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 <87blghbjpn.fsf@HIDDEN> <83y2jlf6wx.fsf@HIDDEN>
Date: Sun, 01 Nov 2020 20:27:41 +0200
In-Reply-To: <83y2jlf6wx.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 01 Nov
 2020 17:11:58 +0200")
Message-ID: <87v9ep54sy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, pogonyshev@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> What is worse is that in a writable buffer, typing 'Ê' should insert
>> this character untranslated, but in the same buffer when it's in
>> read-only view mode, typing the same 'Ê' should translate it to 'q'
>> and quit the buffer with the View-quit command.  When using reverse-im
>> with local-function-key-map, the Help buffer says:
>> 
>>   q (translated from Ê) runs the command View-quit.
>> 
>> So the question is whether it's possible to do the same using
>> XkbTranslateKeyCode?  The local-function-key-map is smart enough
>> to not translate self-inserting keys.  Can code for XkbTranslateKeyCode
>> use the same condition to detect self-inserting keys?
>
> Why do you want XkbTranslateKeyCode to do this? why not the code in
> keyboard.c that reads the event queue and invokes commands?  If we
> make both the key and the character available to keyboard.c, it should
> be able to figure out what is TRT in each situation, I think.

Actually by the phrase "code for XkbTranslateKeyCode" I meant the code
in keyboard.c that could use XkbTranslateKeyCode to do the key translation
between physical keys and characters.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 17:25:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 12:25:16 2020
Received: from localhost ([127.0.0.1]:38370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZH6R-0002gm-Oa
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 12:25:15 -0500
Received: from eggs.gnu.org ([209.51.188.92]:49002)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kZH6Q-0002gX-1i
 for 43830 <at> debbugs.gnu.org; Sun, 01 Nov 2020 12:25:14 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:57903)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kZH6J-0003lT-Gr; Sun, 01 Nov 2020 12:25:07 -0500
Received: from [176.228.60.248] (port=2408 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kZH6H-0003us-CG; Sun, 01 Nov 2020 12:25:07 -0500
Date: Sun, 01 Nov 2020 19:24:52 +0200
Message-Id: <83blghf0rf.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
In-Reply-To: <CAG7Bpaq7PF8AmEwxHhec2J+uzj9GVq9NwHoU90aLWym9Fe3miw@HIDDEN>
 (message from Paul Pogonyshev on Sun, 1 Nov 2020 17:51:00 +0100)
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 <87blghbjpn.fsf@HIDDEN>
 <CAG7Bpaq7PF8AmEwxHhec2J+uzj9GVq9NwHoU90aLWym9Fe3miw@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Paul Pogonyshev <pogonyshev@HIDDEN>
> Date: Sun, 1 Nov 2020 17:51:00 +0100
> Cc: Eli Zaretskii <eliz@HIDDEN>, 43830 <at> debbugs.gnu.org
> 
> > > What about functions like `read-event'? It returns integers if I press
> > > M-[letter] or C-[letter].
> > 
> > read-event is also implemented in C.  But maybe I don't understand
> > your question.
> 
> I mean, what about the cases where it is called from Elisp?  It is
> implemented in C, but also is publicly available.
> 
> I have come up with two ideas:
> 
> 1. `read-event' and its internal C implementation grow an optional
> parameter that says whether to return character as if being typed (as
> now) or for keybinding use (i.e. from physical keys).
> 
> 2. Alternatively, if this cannot be determined in advance (i.e. before
> calling `read-event' etc.), these functions could set variable named sth.
> like `last-keybinding-keycode'. Then the caller would use either the
> return value (as now) or, if it wants, the value of the variable instead.

What I had in mind was

 0. read-event will figure out by itself whether it should return the
 ASCII character or a non-ASCII character, and return that.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 16:51:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 11:51:19 2020
Received: from localhost ([127.0.0.1]:38339 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZGZb-0001rA-Bn
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 11:51:19 -0500
Received: from mail-wr1-f46.google.com ([209.85.221.46]:47067)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kZGZZ-0001qy-Rq
 for 43830 <at> debbugs.gnu.org; Sun, 01 Nov 2020 11:51:18 -0500
Received: by mail-wr1-f46.google.com with SMTP id k10so10501870wrw.13
 for <43830 <at> debbugs.gnu.org>; Sun, 01 Nov 2020 08:51:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=jyg6qJX6sBzwA41BJ6vmfy3nXJtJrlCmyPNdoiQ8niE=;
 b=TAT+y55JzuuY09RF1RZn6IAu6Dj4AbZEsLLJ05MtLFdCoJgWy/wvnqxTW7VC6YKJw6
 43y3YEoy73F8/H9QFcvrhbO9sEQKq/j5R7nR5rqfpFB6fVFy2tNbMDPvoDivFbzdZiL3
 Tns10IAOWlT9gLA4F4PYuRpd2rnNzDf8191ZP6BamMQQ5kWJjWj2JWIXpZBYmxUfF5T/
 wY1jO2tFam5qBPA4GqiEaV7RmJt7pSdS27JwScM1l0FNKP4iYzxz8R9Tq+aEX3ytyahN
 h4zG+RBdVFHMN7SiKCWDMCgM9Uxn3AgHN+H/Tf2SEGg2RxN7KHGCBjvurrV5WWcVIkSN
 D8Wg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=jyg6qJX6sBzwA41BJ6vmfy3nXJtJrlCmyPNdoiQ8niE=;
 b=ujS9HvI8ak8wBLhWMF/jeDmVY6qiuXSY9lZZHbpHprG05nCUXncS9V4nlcIfyQi3R+
 NzIgikFnodEmJhXVagX8GrCu3MevxOpjjLwAgEyX3F7kUWnrYaBjW85nxcoW+E5Z5YQU
 qWKKlaADeiHJ0oAAoHvQUC2uJpZyYnQtGeF7jXeL4ErGwNtohHpfRP8rkyf0wwY+Pm0r
 58B/ZF7Gp8YpcWu7F6LiKd0Wn5Hrtyx58K3bugVy8o0NHC8LS1rUljtaahf8WjDGXJA0
 Hah2jbQkN1XDwBbNBGSnkbvu0iqTpu0c1OLzrBZdi4NyWk1A+GkEijtcptHBxQZx8VTD
 vS7w==
X-Gm-Message-State: AOAM533pTkxRhKArDK+Ov10ke6ISsK3BTR6yZjR7NnQLMBBNFrNCwUo0
 0AwysW56l1t6b8vbiBRS8CmbYD3lkL/eRCnmtw==
X-Google-Smtp-Source: ABdhPJzkD72/TBedAmaY6H/i08H8Vo2smqewtxiVex3eqnb2pG5BncD/uMQ8k6AKjS0axU+HD/a/E74uVg4bShKGAOo=
X-Received: by 2002:adf:b19c:: with SMTP id q28mr15093609wra.119.1604249471801; 
 Sun, 01 Nov 2020 08:51:11 -0800 (PST)
MIME-Version: 1.0
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 <87blghbjpn.fsf@HIDDEN>
In-Reply-To: <87blghbjpn.fsf@HIDDEN>
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Sun, 1 Nov 2020 17:51:00 +0100
Message-ID: <CAG7Bpaq7PF8AmEwxHhec2J+uzj9GVq9NwHoU90aLWym9Fe3miw@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
To: Juri Linkov <juri@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000e5dd1305b30e6fa3"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: Eli Zaretskii <eliz@HIDDEN>, 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000e5dd1305b30e6fa3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

> Could you please give an example how you bind such key sequences as
> 'C-.' and 'C-=D1=87 =D0=B9' in Emacs input modes?  How they do translatio=
n
> to physical keys without using xkb?

I don't and that's the whole point. I want that when _any_ keymap
defines `M-q', this keybinding can be activated by typing M-q or M-=D0=B9,
because this is the same physical key. Automatically.

`reverse-im' achieves this but _only_ for keys that type letters in
the second layout. E.g. M-/ (which I often use) won't work in Russian
layout because that physical letter types '.' in this layout.

> > What about functions like `read-event'? It returns integers if I press
> > M-[letter] or C-[letter].
>
> read-event is also implemented in C.  But maybe I don't understand
> your question.

I mean, what about the cases where it is called from Elisp?  It is
implemented in C, but also is publicly available.

I have come up with two ideas:

1. `read-event' and its internal C implementation grow an optional
parameter that says whether to return character as if being typed (as
now) or for keybinding use (i.e. from physical keys).

2. Alternatively, if this cannot be determined in advance (i.e. before
calling `read-event' etc.), these functions could set variable named sth.
like `last-keybinding-keycode'. Then the caller would use either the
return value (as now) or, if it wants, the value of the variable instead.

Paul

On Sun, 1 Nov 2020 at 09:01, Juri Linkov <juri@HIDDEN> wrote:

> >> Why would you need that?  If we decide to use XkbTranslateKeyCode, we
> >> could translate the keycode in C, according to some logic that took
> >> into account the modifiers and perhaps also some user options, and
> >> returned the resulting translated character.
> >
> > The point is that the character is not enough, you need to know both
> > the character and the physical key (you cannot reconstruct the key
> > from the character alone). E.g. suppose I type '=D0=B9' in Russian layo=
ut.
> > If it is a self-inserting command, character '=D0=B9' should be added t=
o the
> > active buffer. But if I'm typing a multikey binding, it should be
> > interpreted as 'q' (it's the same physical key), so that e.g. 'C-=D1=87=
 =D0=B9' is
> > translated to 'C-x q'.
>
> What is worse is that in a writable buffer, typing '=D0=B9' should insert
> this character untranslated, but in the same buffer when it's in
> read-only view mode, typing the same '=D0=B9' should translate it to 'q'
> and quit the buffer with the View-quit command.  When using reverse-im
> with local-function-key-map, the Help buffer says:
>
>   q (translated from =D0=B9) runs the command View-quit.
>
> So the question is whether it's possible to do the same using
> XkbTranslateKeyCode?  The local-function-key-map is smart enough
> to not translate self-inserting keys.  Can code for XkbTranslateKeyCode
> use the same condition to detect self-inserting keys?
>

--000000000000e5dd1305b30e6fa3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; Could you please give an example how you bind such ke=
y sequences as<br>&gt; &#39;C-.&#39; and &#39;C-=D1=87 =D0=B9&#39; in Emacs=
 input modes?=C2=A0 How they do translation<br>&gt; to physical keys withou=
t using xkb?<br><div><br></div><div>I don&#39;t and that&#39;s the whole po=
int. I want that when _any_ keymap</div><div>defines `M-q&#39;, this keybin=
ding can be activated by typing M-q or M-=D0=B9,</div><div>because this is =
the same physical key. Automatically.</div><div><br></div><div>`reverse-im&=
#39; achieves this but _only_ for keys that type letters in</div><div>the s=
econd layout. E.g. M-/ (which I often use) won&#39;t work in Russian</div><=
div>layout because that physical letter types &#39;.&#39; in this layout.</=
div><div><br></div><div><span class=3D"gmail-im" style=3D"color:rgb(80,0,80=
)">&gt; &gt; What about functions like `read-event&#39;? It returns integer=
s if I press<br>&gt; &gt; M-[letter] or C-[letter].<br>&gt;=C2=A0<br></span=
>&gt; read-event is also implemented in C.=C2=A0 But maybe I don&#39;t unde=
rstand<br>&gt; your question.<br></div><div><br></div><div>I mean, what abo=
ut the cases where it is called from Elisp?=C2=A0 It is</div><div>implement=
ed in C, but also is publicly available.</div><div><br></div><div>I have co=
me up with two ideas:</div><div><br></div><div>1. `read-event&#39; and its =
internal C implementation grow an optional</div><div>parameter that says wh=
ether to return character as if being typed (as</div><div>now) or for keybi=
nding use (i.e. from physical keys).</div><div><br></div><div>2. Alternativ=
ely, if this cannot be determined in advance (i.e. before</div><div>calling=
 `read-event&#39; etc.), these functions could set variable named sth.</div=
><div>like `last-keybinding-keycode&#39;. Then the caller would use either =
the</div><div>return value (as now) or, if it wants, the value of the varia=
ble instead.</div><div><br></div><div>Paul</div></div><br><div class=3D"gma=
il_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, 1 Nov 2020 at 09:01=
, Juri Linkov &lt;<a href=3D"mailto:juri@HIDDEN">juri@HIDDEN</a>&gt=
; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt;&gt=
; Why would you need that?=C2=A0 If we decide to use XkbTranslateKeyCode, w=
e<br>
&gt;&gt; could translate the keycode in C, according to some logic that too=
k<br>
&gt;&gt; into account the modifiers and perhaps also some user options, and=
<br>
&gt;&gt; returned the resulting translated character.<br>
&gt;<br>
&gt; The point is that the character is not enough, you need to know both<b=
r>
&gt; the character and the physical key (you cannot reconstruct the key<br>
&gt; from the character alone). E.g. suppose I type &#39;=D0=B9&#39; in Rus=
sian layout.<br>
&gt; If it is a self-inserting command, character &#39;=D0=B9&#39; should b=
e added to the<br>
&gt; active buffer. But if I&#39;m typing a multikey binding, it should be<=
br>
&gt; interpreted as &#39;q&#39; (it&#39;s the same physical key), so that e=
.g. &#39;C-=D1=87 =D0=B9&#39; is<br>
&gt; translated to &#39;C-x q&#39;.<br>
<br>
What is worse is that in a writable buffer, typing &#39;=D0=B9&#39; should =
insert<br>
this character untranslated, but in the same buffer when it&#39;s in<br>
read-only view mode, typing the same &#39;=D0=B9&#39; should translate it t=
o &#39;q&#39;<br>
and quit the buffer with the View-quit command.=C2=A0 When using reverse-im=
<br>
with local-function-key-map, the Help buffer says:<br>
<br>
=C2=A0 q (translated from =D0=B9) runs the command View-quit.<br>
<br>
So the question is whether it&#39;s possible to do the same using<br>
XkbTranslateKeyCode?=C2=A0 The local-function-key-map is smart enough<br>
to not translate self-inserting keys.=C2=A0 Can code for XkbTranslateKeyCod=
e<br>
use the same condition to detect self-inserting keys?<br>
</blockquote></div>

--000000000000e5dd1305b30e6fa3--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 15:12:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 10:12:21 2020
Received: from localhost ([127.0.0.1]:38135 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZF1o-0003WZ-VK
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 10:12:21 -0500
Received: from eggs.gnu.org ([209.51.188.92]:53776)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kZF1n-0003WN-4c
 for 43830 <at> debbugs.gnu.org; Sun, 01 Nov 2020 10:12:19 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:55744)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kZF1g-0005Ky-Vp; Sun, 01 Nov 2020 10:12:13 -0500
Received: from [176.228.60.248] (port=2171 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kZF1f-0003C7-A5; Sun, 01 Nov 2020 10:12:12 -0500
Date: Sun, 01 Nov 2020 17:11:58 +0200
Message-Id: <83y2jlf6wx.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87blghbjpn.fsf@HIDDEN> (message from Juri Linkov on
 Sun, 01 Nov 2020 09:53:08 +0200)
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 <87blghbjpn.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, pogonyshev@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Juri Linkov <juri@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  43830 <at> debbugs.gnu.org
> Date: Sun, 01 Nov 2020 09:53:08 +0200
> 
> > The point is that the character is not enough, you need to know both
> > the character and the physical key (you cannot reconstruct the key
> > from the character alone). E.g. suppose I type 'Ê' in Russian layout.
> > If it is a self-inserting command, character 'Ê' should be added to the
> > active buffer. But if I'm typing a multikey binding, it should be
> > interpreted as 'q' (it's the same physical key), so that e.g. 'C-Þ Ê' is
> > translated to 'C-x q'.
> 
> What is worse is that in a writable buffer, typing 'Ê' should insert
> this character untranslated, but in the same buffer when it's in
> read-only view mode, typing the same 'Ê' should translate it to 'q'
> and quit the buffer with the View-quit command.  When using reverse-im
> with local-function-key-map, the Help buffer says:
> 
>   q (translated from Ê) runs the command View-quit.
> 
> So the question is whether it's possible to do the same using
> XkbTranslateKeyCode?  The local-function-key-map is smart enough
> to not translate self-inserting keys.  Can code for XkbTranslateKeyCode
> use the same condition to detect self-inserting keys?

Why do you want XkbTranslateKeyCode to do this? why not the code in
keyboard.c that reads the event queue and invokes commands?  If we
make both the key and the character available to keyboard.c, it should
be able to figure out what is TRT in each situation, I think.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 15:09:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 10:09:27 2020
Received: from localhost ([127.0.0.1]:38131 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZEz1-0003S9-Fs
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 10:09:27 -0500
Received: from eggs.gnu.org ([209.51.188.92]:53250)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kZEz0-0003Rx-LP
 for 43830 <at> debbugs.gnu.org; Sun, 01 Nov 2020 10:09:26 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:55694)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kZEyu-0004vk-QN; Sun, 01 Nov 2020 10:09:21 -0500
Received: from [176.228.60.248] (port=1998 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kZEyr-0002wt-IV; Sun, 01 Nov 2020 10:09:18 -0500
Date: Sun, 01 Nov 2020 17:09:05 +0200
Message-Id: <83zh41f71q.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
In-Reply-To: <CAG7BparSLUNzwu-KYgO8_J=WkHk4fAGUY5r1iq+Y_9DiSP=hDw@HIDDEN>
 (message from Paul Pogonyshev on Sun, 1 Nov 2020 01:19:57 +0100)
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 <83d012cnx2.fsf@HIDDEN>
 <CAG7BparSLUNzwu-KYgO8_J=WkHk4fAGUY5r1iq+Y_9DiSP=hDw@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Paul Pogonyshev <pogonyshev@HIDDEN>
> Date: Sun, 1 Nov 2020 01:19:57 +0100
> Cc: Juri Linkov <juri@HIDDEN>, 43830 <at> debbugs.gnu.org
> 
> > No, AFAIR this is all done in C.
> 
> What about functions like `read-event'? It returns integers if I press
> M-[letter] or C-[letter].

read-event is also implemented in C.  But maybe I don't understand
your question.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 08:01:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 03:01:15 2020
Received: from localhost ([127.0.0.1]:35527 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZ8Ic-0000Ma-Rl
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 03:01:15 -0500
Received: from relay10.mail.gandi.net ([217.70.178.230]:54407)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kZ8IY-0000M6-SU
 for 43830 <at> debbugs.gnu.org; Sun, 01 Nov 2020 03:01:12 -0500
Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160])
 (Authenticated sender: juri@HIDDEN)
 by relay10.mail.gandi.net (Postfix) with ESMTPSA id 3CB3C240003;
 Sun,  1 Nov 2020 08:01:02 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
Organization: LINKOV.NET
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
Date: Sun, 01 Nov 2020 09:53:08 +0200
In-Reply-To: <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 (Paul Pogonyshev's message of "Wed, 28 Oct 2020 17:16:59 +0100")
Message-ID: <87blghbjpn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 43830
Cc: Eli Zaretskii <eliz@HIDDEN>, 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> Why would you need that?  If we decide to use XkbTranslateKeyCode, we
>> could translate the keycode in C, according to some logic that took
>> into account the modifiers and perhaps also some user options, and
>> returned the resulting translated character.
>
> The point is that the character is not enough, you need to know both
> the character and the physical key (you cannot reconstruct the key
> from the character alone). E.g. suppose I type 'Ê' in Russian layout.
> If it is a self-inserting command, character 'Ê' should be added to the
> active buffer. But if I'm typing a multikey binding, it should be
> interpreted as 'q' (it's the same physical key), so that e.g. 'C-Þ Ê' is
> translated to 'C-x q'.

What is worse is that in a writable buffer, typing 'Ê' should insert
this character untranslated, but in the same buffer when it's in
read-only view mode, typing the same 'Ê' should translate it to 'q'
and quit the buffer with the View-quit command.  When using reverse-im
with local-function-key-map, the Help buffer says:

  q (translated from Ê) runs the command View-quit.

So the question is whether it's possible to do the same using
XkbTranslateKeyCode?  The local-function-key-map is smart enough
to not translate self-inserting keys.  Can code for XkbTranslateKeyCode
use the same condition to detect self-inserting keys?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 08:01:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 03:01:12 2020
Received: from localhost ([127.0.0.1]:35525 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZ8Ia-0000ML-GV
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 03:01:12 -0500
Received: from relay3-d.mail.gandi.net ([217.70.183.195]:53105)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kZ8IU-0000Lp-WE
 for 43830 <at> debbugs.gnu.org; Sun, 01 Nov 2020 03:01:11 -0500
X-Originating-IP: 91.129.102.160
Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160])
 (Authenticated sender: juri@HIDDEN)
 by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 105DB60003;
 Sun,  1 Nov 2020 08:00:59 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
Organization: LINKOV.NET
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
Date: Sun, 01 Nov 2020 09:48:56 +0200
In-Reply-To: <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 (Paul Pogonyshev's message of "Thu, 8 Oct 2020 15:58:30 +0200")
Message-ID: <87d00xbjpz.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: Eli Zaretskii <eliz@HIDDEN>, 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> By the way, what I forgot to mention, is that Emacs input modes
> perform exactly like I want (i.e. bind to physical keys, so that C-.
> in Russian works as C-/ in English; also e.g. C-Þ Ê is translated to
> C-x q, so even non-modified characters inside bindings work), but
> they have the advantage of knowing the layout, of course.

Could you please give an example how you bind such key sequences as
'C-.' and 'C-Þ Ê' in Emacs input modes?  How they do translation
to physical keys without using xkb?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 00:20:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 31 20:20:17 2020
Received: from localhost ([127.0.0.1]:34951 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZ16X-0005Jb-4a
	for submit <at> debbugs.gnu.org; Sat, 31 Oct 2020 20:20:17 -0400
Received: from mail-wm1-f43.google.com ([209.85.128.43]:55507)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kZ16V-0005JM-1x
 for 43830 <at> debbugs.gnu.org; Sat, 31 Oct 2020 20:20:16 -0400
Received: by mail-wm1-f43.google.com with SMTP id c9so4517286wml.5
 for <43830 <at> debbugs.gnu.org>; Sat, 31 Oct 2020 17:20:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=NreP2nRP5nkIm0mo9OtHjhlSu5uyr+QX1ZG7Lbz3NWg=;
 b=HHa8BHtV5IU8ab016dWV4ZCF+YGeOVRg4MWG5Z1Hpk9L3c213CNoGbP1/hrTDSz1+v
 O/0xM21JM6M3/w1255AwbZ49uJnIhXpvVZrYrrVUG2PG2aohrEH8pTDqNd6Q8qqCtfBc
 Bcd9y6dKJtvp/LC05YMyUUQS8bfM9HGFgQGm45/81iLu3cRYLk8ZdYthxqbS9Z5SdoYi
 3rcZI8rM/4q0w3kKbwgUOK32yyTbKA8bJbR1YyCf6RW7FkPnOsi0yy9xO8cWvc7UUK+j
 LivxH0t6H3RgsFhU3/tWfMCXPszUsZjgaLRcmjUfzTFhf8gtapVl4aLTZN9i/NddNq26
 S3tQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=NreP2nRP5nkIm0mo9OtHjhlSu5uyr+QX1ZG7Lbz3NWg=;
 b=GFA3UxOCCBe7GzT8W8jAAGC4YqBlhDkBzcOsVOUIBEatMcVNcwQsT4fiYblq6IUw6T
 7O7NG5E+a6NFfvfNLIKKkN6DEglE1rRIUMcSx91wSdU7SinrqIQssmrpgrURmguTanUq
 H9edtiH88ulIG2yG9n9jJ0NryQWq0Fylq4BkDznQ9rk8Itteftm8OxCXdgvGR5sb8sNh
 Mv8siEdUEC0ITFgKQ4PbYmaGWQtA4rjhbRZuUWuNsK8J+2LDwaW3RzwRtmD/VKcaGJiM
 ewERz65n0AYP9sfAyDbJ9PuZmQRFp9bEZQD0mlWKx6y6bBWYQcS4YGdWXTa1GLcCY3ze
 wEaA==
X-Gm-Message-State: AOAM531FONJr6TfW1KU/NY9wz9T80t3KsxKGEkUrX7iqKMMXWvNcUjsV
 IjIYLhTvuBlx4z/8euLeI24tzyZ5qZFmp9IIdg==
X-Google-Smtp-Source: ABdhPJyEJeoG5rJoxMxC4dIcXdQm11gzcHYuENt2t5JVAHWTU7oxvcXOOaYq5iXnw7bb9XzY5Dbesye1bxVGx3rXoq0=
X-Received: by 2002:a1c:df89:: with SMTP id w131mr9822967wmg.164.1604190009261; 
 Sat, 31 Oct 2020 17:20:09 -0700 (PDT)
MIME-Version: 1.0
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 <83d012cnx2.fsf@HIDDEN>
In-Reply-To: <83d012cnx2.fsf@HIDDEN>
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Sun, 1 Nov 2020 01:19:57 +0100
Message-ID: <CAG7BparSLUNzwu-KYgO8_J=WkHk4fAGUY5r1iq+Y_9DiSP=hDw@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000a782ff05b300977f"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000a782ff05b300977f
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

> No, AFAIR this is all done in C.

What about functions like `read-event'? It returns integers if I press
M-[letter] or C-[letter].

Paul

On Wed, 28 Oct 2020 at 17:31, Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Paul Pogonyshev <pogonyshev@HIDDEN>
> > Date: Wed, 28 Oct 2020 17:16:59 +0100
> > Cc: Juri Linkov <juri@HIDDEN>, 43830 <at> debbugs.gnu.org
> >
> > > > However, in Elisp this is further complicated by there being no
> > > > real KeyEvent structure, instead it's a single integer as far as I
> > > > can see.
> > >
> > > Why would you need that?  If we decide to use XkbTranslateKeyCode, we
> > > could translate the keycode in C, according to some logic that took
> > > into account the modifiers and perhaps also some user options, and
> > > returned the resulting translated character.
> >
> > The point is that the character is not enough, you need to know both
> > the character and the physical key (you cannot reconstruct the key
> > from the character alone). E.g. suppose I type '=D0=B9' in Russian layo=
ut.
> > If it is a self-inserting command, character '=D0=B9' should be added t=
o the
> > active buffer. But if I'm typing a multikey binding, it should be
> > interpreted as 'q' (it's the same physical key), so that e.g. 'C-=D1=87=
 =D0=B9' is
> > translated to 'C-x q'. Without looking, I'm pretty sure this goes well
> > into Elisp part of Emacs
>
> No, AFAIR this is all done in C.
>

--000000000000a782ff05b300977f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; No, AFAIR this is all done in C.<br><div><br></div><d=
iv>What about functions like `read-event&#39;? It returns integers if I pre=
ss</div><div>M-[letter] or C-[letter].</div><div><br></div><div>Paul</div><=
/div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">O=
n Wed, 28 Oct 2020 at 17:31, Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN=
rg">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex">&gt; From: Paul Pogonyshev &lt;<a href=3D"mailto:pogonyshev=
@gmail.com" target=3D"_blank">pogonyshev@HIDDEN</a>&gt;<br>
&gt; Date: Wed, 28 Oct 2020 17:16:59 +0100<br>
&gt; Cc: Juri Linkov &lt;<a href=3D"mailto:juri@HIDDEN" target=3D"_blan=
k">juri@HIDDEN</a>&gt;, <a href=3D"mailto:43830 <at> debbugs.gnu.org" target=
=3D"_blank">43830 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; &gt; &gt; However, in Elisp this is further complicated by there being=
 no<br>
&gt; &gt; &gt; real KeyEvent structure, instead it&#39;s a single integer a=
s far as I<br>
&gt; &gt; &gt; can see.<br>
&gt; &gt; <br>
&gt; &gt; Why would you need that?=C2=A0 If we decide to use XkbTranslateKe=
yCode, we<br>
&gt; &gt; could translate the keycode in C, according to some logic that to=
ok<br>
&gt; &gt; into account the modifiers and perhaps also some user options, an=
d<br>
&gt; &gt; returned the resulting translated character.<br>
&gt; <br>
&gt; The point is that the character is not enough, you need to know both<b=
r>
&gt; the character and the physical key (you cannot reconstruct the key<br>
&gt; from the character alone). E.g. suppose I type &#39;=D0=B9&#39; in Rus=
sian layout.<br>
&gt; If it is a self-inserting command, character &#39;=D0=B9&#39; should b=
e added to the<br>
&gt; active buffer. But if I&#39;m typing a multikey binding, it should be<=
br>
&gt; interpreted as &#39;q&#39; (it&#39;s the same physical key), so that e=
.g. &#39;C-=D1=87 =D0=B9&#39; is<br>
&gt; translated to &#39;C-x q&#39;. Without looking, I&#39;m pretty sure th=
is goes well<br>
&gt; into Elisp part of Emacs<br>
<br>
No, AFAIR this is all done in C.<br>
</blockquote></div>

--000000000000a782ff05b300977f--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 28 Oct 2020 16:31:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 28 12:31:53 2020
Received: from localhost ([127.0.0.1]:50303 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kXoMb-0004RB-Gs
	for submit <at> debbugs.gnu.org; Wed, 28 Oct 2020 12:31:53 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35036)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kXoMZ-0004Qw-Ec
 for 43830 <at> debbugs.gnu.org; Wed, 28 Oct 2020 12:31:51 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47455)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kXoMT-000872-1I; Wed, 28 Oct 2020 12:31:45 -0400
Received: from [176.228.60.248] (port=3801 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kXoMO-0002Iy-4o; Wed, 28 Oct 2020 12:31:42 -0400
Date: Wed, 28 Oct 2020 18:31:37 +0200
Message-Id: <83d012cnx2.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
In-Reply-To: <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
 (message from Paul Pogonyshev on Wed, 28 Oct 2020 17:16:59 +0100)
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
 <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Paul Pogonyshev <pogonyshev@HIDDEN>
> Date: Wed, 28 Oct 2020 17:16:59 +0100
> Cc: Juri Linkov <juri@HIDDEN>, 43830 <at> debbugs.gnu.org
> 
> > > However, in Elisp this is further complicated by there being no
> > > real KeyEvent structure, instead it's a single integer as far as I
> > > can see.
> > 
> > Why would you need that?  If we decide to use XkbTranslateKeyCode, we
> > could translate the keycode in C, according to some logic that took
> > into account the modifiers and perhaps also some user options, and
> > returned the resulting translated character.
> 
> The point is that the character is not enough, you need to know both
> the character and the physical key (you cannot reconstruct the key
> from the character alone). E.g. suppose I type 'й' in Russian layout.
> If it is a self-inserting command, character 'й' should be added to the
> active buffer. But if I'm typing a multikey binding, it should be
> interpreted as 'q' (it's the same physical key), so that e.g. 'C-ч й' is
> translated to 'C-x q'. Without looking, I'm pretty sure this goes well
> into Elisp part of Emacs

No, AFAIR this is all done in C.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 28 Oct 2020 16:17:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 28 12:17:20 2020
Received: from localhost ([127.0.0.1]:50245 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kXo8V-00041k-LJ
	for submit <at> debbugs.gnu.org; Wed, 28 Oct 2020 12:17:20 -0400
Received: from mail-wr1-f50.google.com ([209.85.221.50]:34428)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kXo8T-00041W-6p
 for 43830 <at> debbugs.gnu.org; Wed, 28 Oct 2020 12:17:17 -0400
Received: by mail-wr1-f50.google.com with SMTP id i1so6372536wro.1
 for <43830 <at> debbugs.gnu.org>; Wed, 28 Oct 2020 09:17:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=FjW88cAvov8c+FplXx7QZsBcfT1QDCWuk6Q68HvSFEs=;
 b=gK4J47PeRG664dlXk9lRrrhXO/U/FDNLC2q5oviYTSJUX4uPt6eTnkVwBoRa6+NmMy
 iF2mRr4ci67hUNeoHJQyIrxTiY/iwLNB4bG7uDMbkBc5kncMK6XNCvXaHLZh0tqET2AO
 9ZDRii6bBTCJtdhVY47ld4+WaICMYmtSLFhA5XZ0/OA/XzFh/SvPeakPWBa8FIrXbiqc
 pXosC4vggGYm7LYvIHNJd9lBdcJjLQsYrgHWiUAd8k0M6yJGR6CGlt5cGPe7z6wSMrc3
 DcneBqq9XVMCEfDe7t/opxse3xCCtHD1fy9rww3iivQTBo3frsX6z/Y6ZaJr9zV6jbRl
 mBEA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=FjW88cAvov8c+FplXx7QZsBcfT1QDCWuk6Q68HvSFEs=;
 b=YLoXroHCRBQMcBLEKVQySOWSE+fQL6umRpJFCzXjf8PUdDBK8HoUX73EoPCWz18k59
 gIORwrNKKeFdJn3qE5p9nYhCMfQ79hOx6Tp9xpqAEGq4+XII5F3PscY9AS9aShkKiegz
 whkrDLD5PSOCclguwuu/gvxV9F5p+Dbbm8WVIENG8jZnjdxz3+6MjZBTzIAFxBbuf62m
 RSW5jvLRqAks4W2tZXUIFMESQfPkpeqiSjOn+XSJDvOD1kSXFvsG8h1jmXH/dOynFYD2
 B4JrrKUKAhxIGgyqOOQ/b5FCyJiaPFhFYW0cflaiz1Ff4XenwUtV/BHfN7k4JpE2cP1X
 M6Pw==
X-Gm-Message-State: AOAM533tea+HiL7cq6xRpKqUDbXxOFTJPOt/EbFoWV++nvNnLxB3/F7Q
 WyYLzrkjUB2nu5GsFLypfDlF7Q8n3N1R43z/vA==
X-Google-Smtp-Source: ABdhPJwx8GsfNgkAgbGykxOgd5wIrBnaxsdPZ1wdic8G6u6eSMU4I88L/SotUYHTPIaSrPtK3Hirv9VPvxQFV+yC0gA=
X-Received: by 2002:adf:80cb:: with SMTP id 69mr9802177wrl.325.1603901831397; 
 Wed, 28 Oct 2020 09:17:11 -0700 (PDT)
MIME-Version: 1.0
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 <83y2jqcrvn.fsf@HIDDEN>
In-Reply-To: <83y2jqcrvn.fsf@HIDDEN>
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Wed, 28 Oct 2020 17:16:59 +0100
Message-ID: <CAG7Bpap18sVTGGuqXDgKRw-jK6W-f7+XL58KHVvmxcvM7gpqDA@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000ea4bd705b2bd7eac"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000ea4bd705b2bd7eac
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

> Is XKB universally available?  AFAICT, we don't require it, but use it
> if available (not for XkbTranslateKeyCode, though).

No. E.g. Java has functions to process keystrokes with and without XKB.
I have no idea how it works without: I use KDE that internally uses XKB.
But AFAIK GNOME (optionally) replaces XKB with something else.

> > However, in Elisp this is further complicated by there being no
> > real KeyEvent structure, instead it's a single integer as far as I
> > can see.
>
> Why would you need that?  If we decide to use XkbTranslateKeyCode, we
> could translate the keycode in C, according to some logic that took
> into account the modifiers and perhaps also some user options, and
> returned the resulting translated character.

The point is that the character is not enough, you need to know both
the character and the physical key (you cannot reconstruct the key
from the character alone). E.g. suppose I type '=D0=B9' in Russian layout.
If it is a self-inserting command, character '=D0=B9' should be added to th=
e
active buffer. But if I'm typing a multikey binding, it should be
interpreted as 'q' (it's the same physical key), so that e.g. 'C-=D1=87 =D0=
=B9' is
translated to 'C-x q'. Without looking, I'm pretty sure this goes well
into Elisp part of Emacs, and changing key events from integers to
something else would be a compatibility nightmare.

Paul


On Wed, 28 Oct 2020 at 16:06, Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Paul Pogonyshev <pogonyshev@HIDDEN>
> > Date: Wed, 28 Oct 2020 01:43:04 +0100
> > Cc: Juri Linkov <juri@HIDDEN>, 43830 <at> debbugs.gnu.org
> >
> > Apparently what Java does internally is calling function
> > XkbTranslateKeyCode() to translate 'keycode' that corresponds
> > to a physical key into a character using the current XKB layout.
>
> Is XKB universally available?  AFAICT, we don't require it, but use it
> if available (not for XkbTranslateKeyCode, though).
>
> > However, in Elisp this is further complicated by there being no
> > real KeyEvent structure, instead it's a single integer as far as I
> > can see.
>
> Why would you need that?  If we decide to use XkbTranslateKeyCode, we
> could translate the keycode in C, according to some logic that took
> into account the modifiers and perhaps also some user options, and
> returned the resulting translated character.
>

--000000000000ea4bd705b2bd7eac
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; Is XKB universally available?=C2=A0 AFAICT, we don&#3=
9;t require it, but use it<br>&gt; if available (not for XkbTranslateKeyCod=
e, though).<br><div><br></div><div>No. E.g. Java has functions to process k=
eystrokes with and without XKB.</div><div>I have no idea how it works witho=
ut: I use KDE that internally uses XKB.</div><div>But AFAIK GNOME (optional=
ly) replaces XKB with something else.</div><div><br></div><div><span class=
=3D"gmail-im" style=3D"color:rgb(80,0,80)">&gt; &gt; However, in Elisp this=
 is further complicated by there being no<br>&gt; &gt; real KeyEvent struct=
ure, instead it&#39;s a single integer as far as I<br>&gt; &gt; can see.<br=
>&gt;=C2=A0<br></span>&gt; Why would you need that?=C2=A0 If we decide to u=
se XkbTranslateKeyCode, we<br>&gt; could translate the keycode in C, accord=
ing to some logic that took<br>&gt; into account the modifiers and perhaps =
also some user options, and<br>&gt; returned the resulting translated chara=
cter.<br></div><div><br></div><div>The point is that the character is not e=
nough, you need to know both</div><div>the character and the physical key (=
you cannot reconstruct the key</div><div>from the character alone). E.g. su=
ppose I type &#39;=D0=B9&#39; in Russian layout.</div><div>If it is a self-=
inserting command, character &#39;=D0=B9&#39; should be added to the</div><=
div>active buffer. But if I&#39;m typing a multikey binding, it should be</=
div><div>interpreted as &#39;q&#39; (it&#39;s the same physical key), so th=
at e.g. &#39;C-=D1=87 =D0=B9&#39; is</div><div>translated to &#39;C-x q&#39=
;. Without looking, I&#39;m pretty sure this goes well</div><div>into Elisp=
 part of Emacs, and changing key events from integers to</div><div>somethin=
g else would be a compatibility nightmare.</div><div><br></div><div>Paul</d=
iv><div><br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cla=
ss=3D"gmail_attr">On Wed, 28 Oct 2020 at 16:06, Eli Zaretskii &lt;<a href=
=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli=
d rgb(204,204,204);padding-left:1ex">&gt; From: Paul Pogonyshev &lt;<a href=
=3D"mailto:pogonyshev@HIDDEN" target=3D"_blank">pogonyshev@HIDDEN</a>=
&gt;<br>
&gt; Date: Wed, 28 Oct 2020 01:43:04 +0100<br>
&gt; Cc: Juri Linkov &lt;<a href=3D"mailto:juri@HIDDEN" target=3D"_blan=
k">juri@HIDDEN</a>&gt;, <a href=3D"mailto:43830 <at> debbugs.gnu.org" target=
=3D"_blank">43830 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; Apparently what Java does internally is calling function<br>
&gt; XkbTranslateKeyCode() to translate &#39;keycode&#39; that corresponds<=
br>
&gt; to a physical key into a character using the current XKB layout.<br>
<br>
Is XKB universally available?=C2=A0 AFAICT, we don&#39;t require it, but us=
e it<br>
if available (not for XkbTranslateKeyCode, though).<br>
<br>
&gt; However, in Elisp this is further complicated by there being no<br>
&gt; real KeyEvent structure, instead it&#39;s a single integer as far as I=
<br>
&gt; can see.<br>
<br>
Why would you need that?=C2=A0 If we decide to use XkbTranslateKeyCode, we<=
br>
could translate the keycode in C, according to some logic that took<br>
into account the modifiers and perhaps also some user options, and<br>
returned the resulting translated character.<br>
</blockquote></div>

--000000000000ea4bd705b2bd7eac--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 28 Oct 2020 15:06:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 28 11:06:18 2020
Received: from localhost ([127.0.0.1]:50112 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kXn1m-00028r-6Z
	for submit <at> debbugs.gnu.org; Wed, 28 Oct 2020 11:06:18 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41530)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kXn1k-00028c-08
 for 43830 <at> debbugs.gnu.org; Wed, 28 Oct 2020 11:06:16 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:45864)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kXn1e-0004lJ-73; Wed, 28 Oct 2020 11:06:10 -0400
Received: from [176.228.60.248] (port=2173 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kXn1a-0002Wy-HU; Wed, 28 Oct 2020 11:06:07 -0400
Date: Wed, 28 Oct 2020 17:06:04 +0200
Message-Id: <83y2jqcrvn.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
In-Reply-To: <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
 (message from Paul Pogonyshev on Wed, 28 Oct 2020 01:43:04 +0100)
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
 <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Paul Pogonyshev <pogonyshev@HIDDEN>
> Date: Wed, 28 Oct 2020 01:43:04 +0100
> Cc: Juri Linkov <juri@HIDDEN>, 43830 <at> debbugs.gnu.org
> 
> Apparently what Java does internally is calling function
> XkbTranslateKeyCode() to translate 'keycode' that corresponds
> to a physical key into a character using the current XKB layout.

Is XKB universally available?  AFAICT, we don't require it, but use it
if available (not for XkbTranslateKeyCode, though).

> However, in Elisp this is further complicated by there being no
> real KeyEvent structure, instead it's a single integer as far as I
> can see.

Why would you need that?  If we decide to use XkbTranslateKeyCode, we
could translate the keycode in C, according to some logic that took
into account the modifiers and perhaps also some user options, and
returned the resulting translated character.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 28 Oct 2020 00:43:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 27 20:43:24 2020
Received: from localhost ([127.0.0.1]:46421 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kXZYi-0006sM-BX
	for submit <at> debbugs.gnu.org; Tue, 27 Oct 2020 20:43:24 -0400
Received: from mail-wr1-f47.google.com ([209.85.221.47]:32855)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kXZYg-0006s9-1k
 for 43830 <at> debbugs.gnu.org; Tue, 27 Oct 2020 20:43:22 -0400
Received: by mail-wr1-f47.google.com with SMTP id b8so3893054wrn.0
 for <43830 <at> debbugs.gnu.org>; Tue, 27 Oct 2020 17:43:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=gqSWFK0urn0+pz5NWQXEzjYNj8ADFYKBLXnaXL78WtU=;
 b=GZKffG0d42PNhPdeYbyLtIwvmtxvDXgPCPwWaIucpx3oL68hHztcDSwiEkn8VQ6egH
 ZKjEVtmJ5AZlETbA+jmGpBVZog9HFynVioBPtu7noPDcBXq+QIG+d/GBopVMjs7qH/nu
 mExcCOQ09SX2aKNNXAxzHagNP5vfSa/gg6le3fJWAri3Ewv/nyU0Ehgw97Yk73n70FFI
 dnb19/YhofqasSymgJ40JvaMnXJy9SFjRHkD6UA20YopcyxzFMoXEbEYkASbLguiiGUl
 Q3YIVWsfNHsm+w1nIDOeHQFKlCaPjftlUaHMXIQ9EPY+IDBmPnFzLqWpYLazJa6n0Sho
 Mc1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=gqSWFK0urn0+pz5NWQXEzjYNj8ADFYKBLXnaXL78WtU=;
 b=LhFwWdhM6xHpxI63X7Tqk+RUBRdYkdtpA+emljL/2icsSAtWqRxpQT6TwEvcxRSgoT
 8QILIjlEBFj9Kj/ie8Y9/oFci5Sct24/nj6rM6tQoJeVcL2VK+yV5WAAZ+S22KVhP1N4
 69vKfSIrBjC1406oSifbESHnOHL5DR9Z9t03HOnvtrRePNzxBe5WfZu8c9oyktrShQU/
 TkoSPtFheJtmxj2TS/Ny/KIu9JOkT5hU0oqp9k8SyenlRGlP5wNZDebSkE2XoPIj8UPc
 +z7Q3jnGrAuuuuED5I76ha7l5MmL0RibuxmHkUJzSAMwlFRmUGBiUZGs5Ygsb3XVK0F1
 tqNA==
X-Gm-Message-State: AOAM532cPgcFTQrWL9ECwF/U48LXcyWJIkflzPACmhSpjUG9blf+YLix
 148+YUjSoNJbPL3StHF8RO+HXuxCdLtRNdrXDQ==
X-Google-Smtp-Source: ABdhPJzbwu6MCyk4XLFkTfCtEY+CgKN1M/Og+EP4gPTp45Bd/K0d3X+8KfY37XbyieHZAaUhlGIpIhlWKP4ElIHwZjU=
X-Received: by 2002:adf:b19c:: with SMTP id q28mr5533885wra.119.1603845795972; 
 Tue, 27 Oct 2020 17:43:15 -0700 (PDT)
MIME-Version: 1.0
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
 <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
In-Reply-To: <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Wed, 28 Oct 2020 01:43:04 +0100
Message-ID: <CAG7BpaoPi96irUWr4SPvNLKmTeknxpOEZiX4wzMge8=L8uEKQQ@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000f1881605b2b07262"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000f1881605b2b07262
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Apparently what Java does internally is calling function
XkbTranslateKeyCode() to translate 'keycode' that corresponds
to a physical key into a character using the current XKB layout.
And then passes on its own KeyEvent object that contains both
the character and the physical typed key, with downstream
code using either of the two, depending on situation (i.e. when
text is being typed, character is used, when bindings like Alt+X
are activated X states for the physical key, which can also e.g.
type =D0=A7 in Russian layout).

However, in Elisp this is further complicated by there being no
real KeyEvent structure, instead it's a single integer as far as I
can see. Since this is not OOP, changing anything here would
mean a thousand incompatibilities all over the place, so it's
easier to just give up and live with the non-perfect workaround
of reverse-im as suggested.

Paul


On Thu, 8 Oct 2020 at 15:58, Paul Pogonyshev <pogonyshev@HIDDEN> wrote:

> > The issue is more general than just a single character with a
> > modifier, because key sequences such as "C-x z" will still not
> > work: the 'z' will become the corresponding non-ASCII character
> > when a non-US keyboard layout is used.  Therefore, the only general
> > solution is for Emacs to be aware of the keyboard layout in use,
> > and map the characters internally to their ASCII equivalents using
> > that layout.
>
> Probably yes, I don't know how other applications do it internally.
> As I mentioned, LibreOffice and IDEA (both are probably Java) do
> it somehow, so there is a way. Maybe I'll try to dig through it later,
> since I'm very familiar with Java.
>
> By the way, what I forgot to mention, is that Emacs input modes
> perform exactly like I want (i.e. bind to physical keys, so that C-.
> in Russian works as C-/ in English; also e.g. C-=D1=87 =D0=B9 is translat=
ed to
> C-x q, so even non-modified characters inside bindings work), but
> they have the advantage of knowing the layout, of course. And,
> as I mentioned, there are two problems with them: 1) I have to
> use C-\ to switch and 2) configuration of `xkb' is bypassed.
>
> Paul
>
>
>
> On Thu, 8 Oct 2020 at 10:49, Eli Zaretskii <eliz@HIDDEN> wrote:
>
>> > From: Juri Linkov <juri@HIDDEN>
>> > Cc: pogonyshev@HIDDEN,  43830 <at> debbugs.gnu.org
>> > Date: Wed, 07 Oct 2020 22:01:47 +0300
>> >
>> > >> We already discussed this 10 years ago, and the conclusion was that
>> > >> it would require too fundamental changes in how Emacs processes
>> keystrokes.
>> > >
>> > > Can you point me to that discussion?
>> >
>> > https://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01237.html
>>
>> Thanks.
>>
>> My take out of that discussion:
>>
>>  . There's a patch in
>>    https://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01384.html
>>    which seems to allow what Paul wanted with single characters with
>>    modifiers, such as C-z or M-s.  That patch has a disadvantage that
>>    it disables AltGr, but if we install that patch as an optional
>>    feature, perhaps the disadvantage is not so bad?
>>
>>  . The issue is more general than just a single character with a
>>    modifier, because key sequences such as "C-x z" will still not
>>    work: the 'z' will become the corresponding non-ASCII character
>>    when a non-US keyboard layout is used.  Therefore, the only general
>>    solution is for Emacs to be aware of the keyboard layout in use,
>>    and map the characters internally to their ASCII equivalents using
>>    that layout.
>>
>> (The discussions also included LEIM features, but I think that is a
>> separate issue.)
>>
>

--000000000000f1881605b2b07262
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Apparently what Java does internally is calling function<d=
iv><span style=3D"color:rgb(0,0,0);font-family:&quot;Times New Roman&quot;;=
font-size:medium"></span>XkbTranslateKeyCode() to translate &#39;keycode&#3=
9; that corresponds</div><div>to a physical key into a character using the =
current XKB layout.<br></div><div>And then passes on its own KeyEvent objec=
t that contains both</div><div>the character and the physical typed key, wi=
th downstream</div><div>code using either of the two, depending on situatio=
n (i.e. when</div><div>text is being typed, character is used, when binding=
s like Alt+X</div><div>are activated X states for the physical key, which c=
an also e.g.</div><div>type =D0=A7 in Russian layout).</div><div><br></div>=
<div>However, in Elisp this is further complicated by there being no</div><=
div>real KeyEvent structure, instead it&#39;s a single integer as far as I<=
/div><div>can see. Since this is not OOP, changing anything here would</div=
><div>mean a thousand incompatibilities all over the place, so it&#39;s</di=
v><div>easier to just give up and live with the non-perfect workaround</div=
><div>of reverse-im as suggested.</div><div><br></div><div>Paul</div><div><=
br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gma=
il_attr">On Thu, 8 Oct 2020 at 15:58, Paul Pogonyshev &lt;<a href=3D"mailto=
:pogonyshev@HIDDEN">pogonyshev@HIDDEN</a>&gt; wrote:<br></div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">&gt; The issue =
is more general than just a single character with a<br>&gt; modifier, becau=
se key sequences such as &quot;C-x z&quot; will still not<br>&gt; work: the=
 &#39;z&#39; will become the corresponding non-ASCII character<br>&gt; when=
 a non-US keyboard layout is used.=C2=A0 Therefore, the only general<br>&gt=
; solution is for Emacs to be aware of the keyboard layout in use,<br>&gt; =
and map the characters internally to their ASCII equivalents using<br>&gt; =
that layout.<br><div><br></div><div>Probably yes, I don&#39;t know how othe=
r applications do it internally.</div><div>As I mentioned, LibreOffice and =
IDEA (both are probably Java) do</div><div>it somehow, so there is a way. M=
aybe I&#39;ll try to dig through it later,</div><div>since I&#39;m very fam=
iliar with Java.</div><div><br></div><div>By the way, what I forgot to ment=
ion, is that Emacs input modes</div><div>perform exactly like I want (i.e. =
bind to physical keys, so that C-.</div><div>in Russian works as C-/ in Eng=
lish; also e.g. C-=D1=87 =D0=B9 is translated to</div><div>C-x q, so even n=
on-modified characters inside bindings work), but</div><div>they have the a=
dvantage of knowing the layout, of course. And,</div><div>as I mentioned, t=
here are two problems with them: 1) I have to</div><div>use C-\ to switch a=
nd 2) configuration of `xkb&#39; is bypassed.</div><div><br></div><div>Paul=
</div><div><br></div><div><br></div></div><br><div class=3D"gmail_quote"><d=
iv dir=3D"ltr" class=3D"gmail_attr">On Thu, 8 Oct 2020 at 10:49, Eli Zarets=
kii &lt;<a href=3D"mailto:eliz@HIDDEN" target=3D"_blank">eliz@HIDDEN</a>&=
gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; =
From: Juri Linkov &lt;<a href=3D"mailto:juri@HIDDEN" target=3D"_blank">=
juri@HIDDEN</a>&gt;<br>
&gt; Cc: <a href=3D"mailto:pogonyshev@HIDDEN" target=3D"_blank">pogonysh=
ev@HIDDEN</a>,=C2=A0 <a href=3D"mailto:43830 <at> debbugs.gnu.org" target=3D"=
_blank">43830 <at> debbugs.gnu.org</a><br>
&gt; Date: Wed, 07 Oct 2020 22:01:47 +0300<br>
&gt; <br>
&gt; &gt;&gt; We already discussed this 10 years ago, and the conclusion wa=
s that<br>
&gt; &gt;&gt; it would require too fundamental changes in how Emacs process=
es keystrokes.<br>
&gt; &gt;<br>
&gt; &gt; Can you point me to that discussion?<br>
&gt; <br>
&gt; <a href=3D"https://lists.gnu.org/archive/html/emacs-devel/2005-11/msg0=
1237.html" rel=3D"noreferrer" target=3D"_blank">https://lists.gnu.org/archi=
ve/html/emacs-devel/2005-11/msg01237.html</a><br>
<br>
Thanks.<br>
<br>
My take out of that discussion:<br>
<br>
=C2=A0. There&#39;s a patch in<br>
=C2=A0 =C2=A0<a href=3D"https://lists.gnu.org/archive/html/emacs-devel/2005=
-11/msg01384.html" rel=3D"noreferrer" target=3D"_blank">https://lists.gnu.o=
rg/archive/html/emacs-devel/2005-11/msg01384.html</a><br>
=C2=A0 =C2=A0which seems to allow what Paul wanted with single characters w=
ith<br>
=C2=A0 =C2=A0modifiers, such as C-z or M-s.=C2=A0 That patch has a disadvan=
tage that<br>
=C2=A0 =C2=A0it disables AltGr, but if we install that patch as an optional=
<br>
=C2=A0 =C2=A0feature, perhaps the disadvantage is not so bad?<br>
<br>
=C2=A0. The issue is more general than just a single character with a<br>
=C2=A0 =C2=A0modifier, because key sequences such as &quot;C-x z&quot; will=
 still not<br>
=C2=A0 =C2=A0work: the &#39;z&#39; will become the corresponding non-ASCII =
character<br>
=C2=A0 =C2=A0when a non-US keyboard layout is used.=C2=A0 Therefore, the on=
ly general<br>
=C2=A0 =C2=A0solution is for Emacs to be aware of the keyboard layout in us=
e,<br>
=C2=A0 =C2=A0and map the characters internally to their ASCII equivalents u=
sing<br>
=C2=A0 =C2=A0that layout.<br>
<br>
(The discussions also included LEIM features, but I think that is a<br>
separate issue.)<br>
</blockquote></div>
</blockquote></div>

--000000000000f1881605b2b07262--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 8 Oct 2020 13:58:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 08 09:58:51 2020
Received: from localhost ([127.0.0.1]:32853 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kQWRX-0006b5-D8
	for submit <at> debbugs.gnu.org; Thu, 08 Oct 2020 09:58:51 -0400
Received: from mail-wr1-f50.google.com ([209.85.221.50]:40389)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kQWRU-0006aq-F8
 for 43830 <at> debbugs.gnu.org; Thu, 08 Oct 2020 09:58:50 -0400
Received: by mail-wr1-f50.google.com with SMTP id j2so6728430wrx.7
 for <43830 <at> debbugs.gnu.org>; Thu, 08 Oct 2020 06:58:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=9oyathYb0QTDMcLB33Xqvtbl8PblXR/wgVg6hDjhgRU=;
 b=F826rQiMnWHMFztblKm0jkYPLqiY0xdlFXy7h0ZNxYtvOuJ3nKYLno0X8aBzYKX8s8
 srFx5/hw1pOYDPSV6v0DGZgmgursvDU+pup+cDkgu1G/o99GLziYEDMuKuvvbZyE4NHr
 Sd1wSCxU6nhA6B8o9q+wBNS4DACk7JjGXrVVxPl925NVJmNPk3og6rYXvKq0liKvuZ+U
 oe9NCHz9PY7xt6yUOncG1mVczs8bxjVyrZOpzBUEVaIkhXdtVqP5Vvn29XebtPxNdE/k
 UCmaQhB7+Osm84yK/M9ogShfX/0ExlSTKk7WcjB1HTJmCGVwSrtHj4lkxaripQW74Ozh
 ugKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=9oyathYb0QTDMcLB33Xqvtbl8PblXR/wgVg6hDjhgRU=;
 b=fvYz8SmruC9eggI6ZdOFp/YFSz3Kg+UHfvzl6bUNDGSldP2NpKkD+QOLxidSUPQAOR
 V/xwUVy5ygXivIWjgXmoJ+7faOBiVevIF0rAhqVeeOo4HUv9EOS3IILXTMF1zCGe+/Bx
 zZIcuC4N8e7dq17aRaUuUkhp2UUAi4SCEkjxJ76pT3qkFzBa70X6bn61+C8K9Aiiqg8/
 10eiwW8MI8aykUQDTq5gp33k2+VLxZBTJEWaN0Bq6/7BXggE3O1RC11HR5N3bD1RBptb
 +5veGzv1cuPS+ihnqJWUn51IaxZuZ8hj3IeXdlE81ZTsvljQNkUKNiQ9eSOTD/2K98ZW
 clBQ==
X-Gm-Message-State: AOAM533E/4SVQ6IGv2uib7srmtFLUgvduA7Eva725OTyWRik+CkuBxlQ
 xdxr4F+Y29JHZhSi3CyrfNFelfMCpLAnIgH0Wg==
X-Google-Smtp-Source: ABdhPJzOa8pKDHBBekHOEK8O0Y/Val1LQQhOJKoJGL8sOxBrGHCG00s8zqE+c7iuanbnb3wB3sB28pyWmI726kz5jws=
X-Received: by 2002:a5d:5583:: with SMTP id i3mr9226074wrv.119.1602165522420; 
 Thu, 08 Oct 2020 06:58:42 -0700 (PDT)
MIME-Version: 1.0
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN> <83362p85l3.fsf@HIDDEN>
In-Reply-To: <83362p85l3.fsf@HIDDEN>
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Thu, 8 Oct 2020 15:58:30 +0200
Message-ID: <CAG7Bpao-jS-m4ufTzf1zHbWJj0_iPxUsS+BWh-YQQ74wB0YGcg@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000d5d6f305b1293ae7"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000d5d6f305b1293ae7
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

> The issue is more general than just a single character with a
> modifier, because key sequences such as "C-x z" will still not
> work: the 'z' will become the corresponding non-ASCII character
> when a non-US keyboard layout is used.  Therefore, the only general
> solution is for Emacs to be aware of the keyboard layout in use,
> and map the characters internally to their ASCII equivalents using
> that layout.

Probably yes, I don't know how other applications do it internally.
As I mentioned, LibreOffice and IDEA (both are probably Java) do
it somehow, so there is a way. Maybe I'll try to dig through it later,
since I'm very familiar with Java.

By the way, what I forgot to mention, is that Emacs input modes
perform exactly like I want (i.e. bind to physical keys, so that C-.
in Russian works as C-/ in English; also e.g. C-=D1=87 =D0=B9 is translated=
 to
C-x q, so even non-modified characters inside bindings work), but
they have the advantage of knowing the layout, of course. And,
as I mentioned, there are two problems with them: 1) I have to
use C-\ to switch and 2) configuration of `xkb' is bypassed.

Paul



On Thu, 8 Oct 2020 at 10:49, Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Juri Linkov <juri@HIDDEN>
> > Cc: pogonyshev@HIDDEN,  43830 <at> debbugs.gnu.org
> > Date: Wed, 07 Oct 2020 22:01:47 +0300
> >
> > >> We already discussed this 10 years ago, and the conclusion was that
> > >> it would require too fundamental changes in how Emacs processes
> keystrokes.
> > >
> > > Can you point me to that discussion?
> >
> > https://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01237.html
>
> Thanks.
>
> My take out of that discussion:
>
>  . There's a patch in
>    https://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01384.html
>    which seems to allow what Paul wanted with single characters with
>    modifiers, such as C-z or M-s.  That patch has a disadvantage that
>    it disables AltGr, but if we install that patch as an optional
>    feature, perhaps the disadvantage is not so bad?
>
>  . The issue is more general than just a single character with a
>    modifier, because key sequences such as "C-x z" will still not
>    work: the 'z' will become the corresponding non-ASCII character
>    when a non-US keyboard layout is used.  Therefore, the only general
>    solution is for Emacs to be aware of the keyboard layout in use,
>    and map the characters internally to their ASCII equivalents using
>    that layout.
>
> (The discussions also included LEIM features, but I think that is a
> separate issue.)
>

--000000000000d5d6f305b1293ae7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; The issue is more general than just a single characte=
r with a<br>&gt; modifier, because key sequences such as &quot;C-x z&quot; =
will still not<br>&gt; work: the &#39;z&#39; will become the corresponding =
non-ASCII character<br>&gt; when a non-US keyboard layout is used.=C2=A0 Th=
erefore, the only general<br>&gt; solution is for Emacs to be aware of the =
keyboard layout in use,<br>&gt; and map the characters internally to their =
ASCII equivalents using<br>&gt; that layout.<br><div><br></div><div>Probabl=
y yes, I don&#39;t know how other applications do it internally.</div><div>=
As I mentioned, LibreOffice and IDEA (both are probably Java) do</div><div>=
it somehow, so there is a way. Maybe I&#39;ll try to dig through it later,<=
/div><div>since I&#39;m very familiar with Java.</div><div><br></div><div>B=
y the way, what I forgot to mention, is that Emacs input modes</div><div>pe=
rform exactly like I want (i.e. bind to physical keys, so that C-.</div><di=
v>in Russian works as C-/ in English; also e.g. C-=D1=87 =D0=B9 is translat=
ed to</div><div>C-x q, so even non-modified characters inside bindings work=
), but</div><div>they have the advantage of knowing the layout, of course. =
And,</div><div>as I mentioned, there are two problems with them: 1) I have =
to</div><div>use C-\ to switch and 2) configuration of `xkb&#39; is bypasse=
d.</div><div><br></div><div>Paul</div><div><br></div><div><br></div></div><=
br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu,=
 8 Oct 2020 at 10:49, Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN">eli=
z@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">&gt; From: Juri Linkov &lt;<a href=3D"mailto:juri@HIDDEN" ta=
rget=3D"_blank">juri@HIDDEN</a>&gt;<br>
&gt; Cc: <a href=3D"mailto:pogonyshev@HIDDEN" target=3D"_blank">pogonysh=
ev@HIDDEN</a>,=C2=A0 <a href=3D"mailto:43830 <at> debbugs.gnu.org" target=3D"=
_blank">43830 <at> debbugs.gnu.org</a><br>
&gt; Date: Wed, 07 Oct 2020 22:01:47 +0300<br>
&gt; <br>
&gt; &gt;&gt; We already discussed this 10 years ago, and the conclusion wa=
s that<br>
&gt; &gt;&gt; it would require too fundamental changes in how Emacs process=
es keystrokes.<br>
&gt; &gt;<br>
&gt; &gt; Can you point me to that discussion?<br>
&gt; <br>
&gt; <a href=3D"https://lists.gnu.org/archive/html/emacs-devel/2005-11/msg0=
1237.html" rel=3D"noreferrer" target=3D"_blank">https://lists.gnu.org/archi=
ve/html/emacs-devel/2005-11/msg01237.html</a><br>
<br>
Thanks.<br>
<br>
My take out of that discussion:<br>
<br>
=C2=A0. There&#39;s a patch in<br>
=C2=A0 =C2=A0<a href=3D"https://lists.gnu.org/archive/html/emacs-devel/2005=
-11/msg01384.html" rel=3D"noreferrer" target=3D"_blank">https://lists.gnu.o=
rg/archive/html/emacs-devel/2005-11/msg01384.html</a><br>
=C2=A0 =C2=A0which seems to allow what Paul wanted with single characters w=
ith<br>
=C2=A0 =C2=A0modifiers, such as C-z or M-s.=C2=A0 That patch has a disadvan=
tage that<br>
=C2=A0 =C2=A0it disables AltGr, but if we install that patch as an optional=
<br>
=C2=A0 =C2=A0feature, perhaps the disadvantage is not so bad?<br>
<br>
=C2=A0. The issue is more general than just a single character with a<br>
=C2=A0 =C2=A0modifier, because key sequences such as &quot;C-x z&quot; will=
 still not<br>
=C2=A0 =C2=A0work: the &#39;z&#39; will become the corresponding non-ASCII =
character<br>
=C2=A0 =C2=A0when a non-US keyboard layout is used.=C2=A0 Therefore, the on=
ly general<br>
=C2=A0 =C2=A0solution is for Emacs to be aware of the keyboard layout in us=
e,<br>
=C2=A0 =C2=A0and map the characters internally to their ASCII equivalents u=
sing<br>
=C2=A0 =C2=A0that layout.<br>
<br>
(The discussions also included LEIM features, but I think that is a<br>
separate issue.)<br>
</blockquote></div>

--000000000000d5d6f305b1293ae7--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 8 Oct 2020 08:50:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 08 04:50:03 2020
Received: from localhost ([127.0.0.1]:58711 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kQRcg-0004pP-Qp
	for submit <at> debbugs.gnu.org; Thu, 08 Oct 2020 04:50:03 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39260)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kQRce-0004oj-Bl
 for 43830 <at> debbugs.gnu.org; Thu, 08 Oct 2020 04:50:01 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:33122)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kQRcX-0000IJ-W4; Thu, 08 Oct 2020 04:49:54 -0400
Received: from [176.228.60.248] (port=2616 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kQRcX-0003RV-DU; Thu, 08 Oct 2020 04:49:53 -0400
Date: Thu, 08 Oct 2020 11:50:00 +0300
Message-Id: <83362p85l3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87blhdrhww.fsf@HIDDEN> (message from Juri Linkov on
 Wed, 07 Oct 2020 22:01:47 +0300)
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
 <87blhdrhww.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, pogonyshev@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Juri Linkov <juri@HIDDEN>
> Cc: pogonyshev@HIDDEN,  43830 <at> debbugs.gnu.org
> Date: Wed, 07 Oct 2020 22:01:47 +0300
> 
> >> We already discussed this 10 years ago, and the conclusion was that
> >> it would require too fundamental changes in how Emacs processes keystrokes.
> >
> > Can you point me to that discussion?
> 
> https://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01237.html

Thanks.

My take out of that discussion:

 . There's a patch in
   https://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01384.html
   which seems to allow what Paul wanted with single characters with
   modifiers, such as C-z or M-s.  That patch has a disadvantage that
   it disables AltGr, but if we install that patch as an optional
   feature, perhaps the disadvantage is not so bad?

 . The issue is more general than just a single character with a
   modifier, because key sequences such as "C-x z" will still not
   work: the 'z' will become the corresponding non-ASCII character
   when a non-US keyboard layout is used.  Therefore, the only general
   solution is for Emacs to be aware of the keyboard layout in use,
   and map the characters internally to their ASCII equivalents using
   that layout.

(The discussions also included LEIM features, but I think that is a
separate issue.)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 7 Oct 2020 20:32:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 07 16:32:15 2020
Received: from localhost ([127.0.0.1]:58187 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kQG6g-0003LR-QL
	for submit <at> debbugs.gnu.org; Wed, 07 Oct 2020 16:32:15 -0400
Received: from relay2-d.mail.gandi.net ([217.70.183.194]:57399)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kQG6d-0003L0-Lo
 for 43830 <at> debbugs.gnu.org; Wed, 07 Oct 2020 16:32:11 -0400
X-Originating-IP: 91.129.102.160
Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160])
 (Authenticated sender: juri@HIDDEN)
 by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 4B84A40004;
 Wed,  7 Oct 2020 20:32:05 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
Organization: LINKOV.NET
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN>
 <CAG7BpaqRnyJ7NZw5ayCmqMxYHh2XLTNCSoMkyYE03qWSVGB9gg@HIDDEN>
 <87h7r5q2mm.fsf@HIDDEN>
 <CAG7Bparh+wh3JirKjK8i4z9rx2MCvk-41XsdVXQsN48zN8uL8w@HIDDEN>
Date: Wed, 07 Oct 2020 23:25:22 +0300
In-Reply-To: <CAG7Bparh+wh3JirKjK8i4z9rx2MCvk-41XsdVXQsN48zN8uL8w@HIDDEN>
 (Paul Pogonyshev's message of "Wed, 7 Oct 2020 22:08:38 +0200")
Message-ID: <871ri9okb1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> Can I do that automagically somehow, given that I switch keyboard layout
> three times a minute when I type? Doing it once won't help anything, since
> that would break shortcuts for English layout, and I want them work the
> same in _all layouts_.

If you rebind e.g. C-. to another command to use in another layout,
it won't work with the initial layout indeed.  reverse-im works well
when you need to rebind only letters, not punctuation.  This problem
is described here: https://github.com/a13/reverse-im.el/issues/6




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 7 Oct 2020 20:08:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 07 16:08:58 2020
Received: from localhost ([127.0.0.1]:58166 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kQFkA-0002nO-BE
	for submit <at> debbugs.gnu.org; Wed, 07 Oct 2020 16:08:58 -0400
Received: from mail-wm1-f46.google.com ([209.85.128.46]:55305)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kQFk7-0002nA-SL
 for 43830 <at> debbugs.gnu.org; Wed, 07 Oct 2020 16:08:56 -0400
Received: by mail-wm1-f46.google.com with SMTP id d4so3787896wmd.5
 for <43830 <at> debbugs.gnu.org>; Wed, 07 Oct 2020 13:08:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=RtHk84w7Zd0NDBLbiuNfFlVtSTMmY+ELOPtF0ZTpF8U=;
 b=uQQTR4luX9ia2CuFv5p/xaArqpJKUurX/PnYW7W4/p4QuUEJ20q4KhmjEuB2LJaAmk
 M0KmidAhYewhx6Wo2jhWs6YyZCRHEepde1PZsH0W4WjZwuQQIF7fIMhQEMIGp3MPPIQL
 b8PYwxVMHikcB36tRIsn9MmL0ITXSHklDg/cL8cohV9ak//a2391FMDt5I5oqne7nBfZ
 ZxKCURmzL0DUw3dPee4CM+Ru0Iz+lt28ZbKFtlhwO2nhOwE36AqYtLgTkdVUaTRtjf5d
 wei2PYPMc4t0m7GbT7C+YFcGo5f2mPKJCTyJAIBJk5kh8EUiFtT1keJMyxDQ1xBXwfaG
 /9Gw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=RtHk84w7Zd0NDBLbiuNfFlVtSTMmY+ELOPtF0ZTpF8U=;
 b=tIk91RE5swdiZpHdBN0ZVVZn0jbTvJberMrAHYxWsT+x961XFRn7GjCVfBpydszcUn
 fJz3dEJt5wx3KJV0bgLHQj3rRW6Ui/h51p+TbY7HUN9uZQoWeziUBHGiRZwJy2nEC/8C
 WEesRmBl1Du27HBQvDTQDpfBHH7+cpVK8pg8gFfDQUaCov+4AUVWU/qpivodTkoO2V7D
 U2CL/VHmeGNMgkyhRIKOXBmCTB5ZeUV1mikkUrqTlEa0moJsjFkAqnt73++HP5dZyAnW
 5HhA6PamO8jnDFPQaEJb8AaPSuAtoANLTZ4waQ4PmPSibAPBKgzoqHsSskLDK+GZHczv
 fjFA==
X-Gm-Message-State: AOAM532sJCwC62kQfB6mnAXfnjwnSsP8A4NQEkBgMjn2Mf847xFXzWiE
 IN3rJB7MKDlt0Zn5kbEka/GJRKprknHB1797RA==
X-Google-Smtp-Source: ABdhPJxR1nzCbN6YeIm5hfVqE2IXcT/ZY/DOktHz1Krpia1Ay26pLXL78J0HfRjqvltjMQVKCxm6plpnLdLIe+p4UCU=
X-Received: by 2002:a1c:67c5:: with SMTP id b188mr4870007wmc.164.1602101329925; 
 Wed, 07 Oct 2020 13:08:49 -0700 (PDT)
MIME-Version: 1.0
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN>
 <CAG7BpaqRnyJ7NZw5ayCmqMxYHh2XLTNCSoMkyYE03qWSVGB9gg@HIDDEN>
 <87h7r5q2mm.fsf@HIDDEN>
In-Reply-To: <87h7r5q2mm.fsf@HIDDEN>
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Wed, 7 Oct 2020 22:08:38 +0200
Message-ID: <CAG7Bparh+wh3JirKjK8i4z9rx2MCvk-41XsdVXQsN48zN8uL8w@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
To: Juri Linkov <juri@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000aa1a8f05b11a48a1"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000aa1a8f05b11a48a1
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

> You said this issue was successfully solved by other applications tens of
> years ago.  Do these apps allow you typing physical key '/' to get '.'
> while keeping invoking C-/, M-/ shortcuts?  I know no such applications,
> they all invoke C-. and M-., not C-/ and M-/.

Actually, I admit I haven't even thought about that. Not many apps have
so many shortcuts that they run out of letters, so I just assumed that they
work by physical key. But a quick test shows mixed results:

* KDE and GTK+ (at least Gimp) seem to work like `reverse-im', i.e. they
don't bind to physical keys, but to characters.

* LibreOffice and IntelliJ IDEA work like I described, i.e. as desired for
me.

* I also discovered that even some ancient X programs (xedit) are smart
enough to hande Ctrl-S and Ctrl-=D0=AB the same, but I have no idea how to
test Ctrl-. there.

My subconciousness doesn't distinguish between letter and non-letter keys,
it remembers shorcuts by physical position of the keys. That's why I think
the second approach (i.e. LibreOffice's and IDEA's) is better.

> But in Emacs you can do everything you want.  If `reverse-im'
> doesn't handle this automatically, you can redefine key mappings for
> '/', 'C-/' and 'M-/' manually (using some code from `reverse-im').

Can I do that automagically somehow, given that I switch keyboard layout
three times a minute when I type? Doing it once won't help anything, since
that would break shortcuts for English layout, and I want them work the
same in _all layouts_.

Paul

On Wed, 7 Oct 2020 at 21:25, Juri Linkov <juri@HIDDEN> wrote:

> >> All these problems are because of mismatch between your X layout and
> >> your Emacs input method.  Emacs doesn't know the X layout, so you need
> >> to define it in Emacs by adapting an existing input method,
> >> or defining different keys manually.
> >
> > Sorry, I don't understand. I also don't see anything about this in the
> > documentation (README).
> >
> > I want physical key that is '/' in English to type '.' in Russian
> (because
> > that is what it does in russian-computer), but invoke shortcuts bound t=
o
> > C-/, M-/ etc. Is that possible with `reverse-im'?
>
> You said this issue was successfully solved by other applications tens of
> years ago.  Do these apps allow you typing physical key '/' to get '.'
> while keeping invoking C-/, M-/ shortcuts?  I know no such applications,
> they all invoke C-. and M-., not C-/ and M-/.
>
> But in Emacs you can do everything you want.  If `reverse-im'
> doesn't handle this automatically, you can redefine key mappings for
> '/', 'C-/' and 'M-/' manually (using some code from `reverse-im').
>

--000000000000aa1a8f05b11a48a1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; You said this issue was successfully solved by other =
applications tens of<br>&gt; years ago.=C2=A0 Do these apps allow you typin=
g physical key &#39;/&#39; to get &#39;.&#39;<br>&gt; while keeping invokin=
g C-/, M-/ shortcuts?=C2=A0 I know no such applications,<br>&gt; they all i=
nvoke C-. and M-., not C-/ and M-/.<br><div><br></div><div>Actually, I admi=
t I haven&#39;t even thought about that. Not many apps have</div><div>so ma=
ny shortcuts that they run out of letters, so I just assumed that they</div=
><div>work by physical key. But a quick test shows mixed results:</div><div=
><br></div><div>* KDE and GTK+ (at least Gimp) seem to work like `reverse-i=
m&#39;, i.e. they</div><div>don&#39;t bind to physical keys, but to charact=
ers.</div><div><br></div><div>* LibreOffice and IntelliJ IDEA work like I d=
escribed, i.e. as desired for me.</div><div><br></div><div>* I also discove=
red that even some ancient X programs (xedit) are smart</div><div>enough to=
 hande Ctrl-S and Ctrl-=D0=AB the same, but I have no idea how to</div><div=
>test Ctrl-. there.</div><div><br></div><div>My subconciousness doesn&#39;t=
 distinguish between letter and non-letter keys,<br></div><div>it remembers=
 shorcuts by physical position of the keys. That&#39;s why I think</div><di=
v>the second approach (i.e. LibreOffice&#39;s and IDEA&#39;s) is better.</d=
iv><div><br></div><div>&gt; But in Emacs you can do everything you want.=C2=
=A0 If `reverse-im&#39;<br>&gt; doesn&#39;t handle this automatically, you =
can redefine key mappings for<br>&gt; &#39;/&#39;, &#39;C-/&#39; and &#39;M=
-/&#39; manually (using some code from `reverse-im&#39;).<br></div><div><br=
></div><div>Can I do that automagically somehow, given that I switch keyboa=
rd layout</div><div>three times a minute when I type? Doing it once won&#39=
;t help anything, since</div><div>that would break shortcuts for English la=
yout, and I want them work the</div><div>same in _all layouts_.</div><div><=
br></div><div>Paul</div></div><br><div class=3D"gmail_quote"><div dir=3D"lt=
r" class=3D"gmail_attr">On Wed, 7 Oct 2020 at 21:25, Juri Linkov &lt;<a hre=
f=3D"mailto:juri@HIDDEN">juri@HIDDEN</a>&gt; wrote:<br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1=
px solid rgb(204,204,204);padding-left:1ex">&gt;&gt; All these problems are=
 because of mismatch between your X layout and<br>
&gt;&gt; your Emacs input method.=C2=A0 Emacs doesn&#39;t know the X layout=
, so you need<br>
&gt;&gt; to define it in Emacs by adapting an existing input method,<br>
&gt;&gt; or defining different keys manually.<br>
&gt;<br>
&gt; Sorry, I don&#39;t understand. I also don&#39;t see anything about thi=
s in the<br>
&gt; documentation (README).<br>
&gt;<br>
&gt; I want physical key that is &#39;/&#39; in English to type &#39;.&#39;=
 in Russian (because<br>
&gt; that is what it does in russian-computer), but invoke shortcuts bound =
to<br>
&gt; C-/, M-/ etc. Is that possible with `reverse-im&#39;?<br>
<br>
You said this issue was successfully solved by other applications tens of<b=
r>
years ago.=C2=A0 Do these apps allow you typing physical key &#39;/&#39; to=
 get &#39;.&#39;<br>
while keeping invoking C-/, M-/ shortcuts?=C2=A0 I know no such application=
s,<br>
they all invoke C-. and M-., not C-/ and M-/.<br>
<br>
But in Emacs you can do everything you want.=C2=A0 If `reverse-im&#39;<br>
doesn&#39;t handle this automatically, you can redefine key mappings for<br=
>
&#39;/&#39;, &#39;C-/&#39; and &#39;M-/&#39; manually (using some code from=
 `reverse-im&#39;).<br>
</blockquote></div>

--000000000000aa1a8f05b11a48a1--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 7 Oct 2020 19:25:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 07 15:25:16 2020
Received: from localhost ([127.0.0.1]:58108 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kQF3s-0001kQ-GH
	for submit <at> debbugs.gnu.org; Wed, 07 Oct 2020 15:25:16 -0400
Received: from relay3-d.mail.gandi.net ([217.70.183.195]:60455)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kQF3l-0001jl-Ka
 for 43830 <at> debbugs.gnu.org; Wed, 07 Oct 2020 15:25:13 -0400
X-Originating-IP: 91.129.102.160
Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160])
 (Authenticated sender: juri@HIDDEN)
 by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A46F960007;
 Wed,  7 Oct 2020 19:25:02 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
Organization: LINKOV.NET
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN>
 <CAG7BpaqRnyJ7NZw5ayCmqMxYHh2XLTNCSoMkyYE03qWSVGB9gg@HIDDEN>
Date: Wed, 07 Oct 2020 22:04:17 +0300
In-Reply-To: <CAG7BpaqRnyJ7NZw5ayCmqMxYHh2XLTNCSoMkyYE03qWSVGB9gg@HIDDEN>
 (Paul Pogonyshev's message of "Wed, 7 Oct 2020 12:37:02 +0200")
Message-ID: <87h7r5q2mm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> All these problems are because of mismatch between your X layout and
>> your Emacs input method.  Emacs doesn't know the X layout, so you need
>> to define it in Emacs by adapting an existing input method,
>> or defining different keys manually.
>
> Sorry, I don't understand. I also don't see anything about this in the
> documentation (README).
>
> I want physical key that is '/' in English to type '.' in Russian (because
> that is what it does in russian-computer), but invoke shortcuts bound to
> C-/, M-/ etc. Is that possible with `reverse-im'?

You said this issue was successfully solved by other applications tens of
years ago.  Do these apps allow you typing physical key '/' to get '.'
while keeping invoking C-/, M-/ shortcuts?  I know no such applications,
they all invoke C-. and M-., not C-/ and M-/.

But in Emacs you can do everything you want.  If `reverse-im'
doesn't handle this automatically, you can redefine key mappings for
'/', 'C-/' and 'M-/' manually (using some code from `reverse-im').




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 7 Oct 2020 19:25:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 07 15:25:13 2020
Received: from localhost ([127.0.0.1]:58105 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kQF3o-0001k2-C6
	for submit <at> debbugs.gnu.org; Wed, 07 Oct 2020 15:25:13 -0400
Received: from relay11.mail.gandi.net ([217.70.178.231]:46973)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kQF3i-0001jM-VN
 for 43830 <at> debbugs.gnu.org; Wed, 07 Oct 2020 15:25:10 -0400
Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160])
 (Authenticated sender: juri@HIDDEN)
 by relay11.mail.gandi.net (Postfix) with ESMTPSA id 6484D100006;
 Wed,  7 Oct 2020 19:24:58 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
Organization: LINKOV.NET
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN> <83362qa073.fsf@HIDDEN>
Date: Wed, 07 Oct 2020 22:01:47 +0300
In-Reply-To: <83362qa073.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 07 Oct
 2020 11:51:12 +0300")
Message-ID: <87blhdrhww.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, pogonyshev@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> > So, it is a good workaround that *mostly* works. But it doesn't solve the
>> > underlying issue. Which was successfully solved by other applications tens
>> > of years ago.
>>
>> We already discussed this 10 years ago, and the conclusion was that
>> it would require too fundamental changes in how Emacs processes keystrokes.
>
> Can you point me to that discussion?

https://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01237.html




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 7 Oct 2020 10:37:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 07 06:37:22 2020
Received: from localhost ([127.0.0.1]:55361 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kQ6p0-00035f-AA
	for submit <at> debbugs.gnu.org; Wed, 07 Oct 2020 06:37:22 -0400
Received: from mail-wm1-f48.google.com ([209.85.128.48]:50426)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kQ6ox-00035N-VC
 for 43830 <at> debbugs.gnu.org; Wed, 07 Oct 2020 06:37:21 -0400
Received: by mail-wm1-f48.google.com with SMTP id 13so1781409wmf.0
 for <43830 <at> debbugs.gnu.org>; Wed, 07 Oct 2020 03:37:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=4QZvcPsbNc12GD0Xlbg+DdzoagWxOgc2+FUZXK2tZJw=;
 b=NMJXMR2Bq9wfxXMmoNrk1537h2FMCfbg2LwSXJajtifajRXkmK3F7IRp82zkhHP/N3
 yVHNV1JdVOMi7cpILKlTgWSKcwnBKBWhEA6D3uvjCLgmX/YcI/1BlrgY2mGfuM0Ajtny
 d8RmWO7GI2MFIVlU3j2fVK4lIvVbKuSI1++fAVW1VbfW7LaiRUBaFqs4DIXojMrEMNye
 blO2P+fOhwmcR7NZ73l+uAWMLqM+FBH9wiaSSSVGtizVCN28+LmmP9TwmfEZKyTL4ElY
 rBMw6l16dNKjhHCfUucZem/0yqGm81+8kr6feOTzbPja2cTdCTTo7Iha9v032Ix16Z4D
 Wydw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=4QZvcPsbNc12GD0Xlbg+DdzoagWxOgc2+FUZXK2tZJw=;
 b=pmtZjpCy/xjaLpvoAvFYqnFGGdwIhQyhJYxtQFLhI62m+9IfnCVIcNSrgpizh4PdzW
 SjPipqixK/CxdSyjgFAtQtm5QjuxFpRulV0Ff+TfdRmf9rUoQgS/L3DEXK9ZdOxPTO5J
 5px/ma6pNmmUOKTSUqo/qPy+JzdW4GHoFeoaLjhi7gKK/f0anflN3KQA3KT6Np++bNoU
 TTsjjwIY87VVkqWWIhNFI7aFxkb4Q9NCW5TuCSYIcA2fMCcl4pMxe50gU37dj7WqHk6t
 22ajSdjPnoctLQRf2HyStADa++5BJoH6/gBAluRdr/8bCvA494nPC+QE4jfpRkF1jgKW
 Qmbg==
X-Gm-Message-State: AOAM530DeydGNm5UQHVazR2ikU5fovqbvXe0uUkks/RvNoExG1ewejkl
 RYHzzDCqlE5hQuLfNVg5P/ovszE4tAZ1PqrvMA==
X-Google-Smtp-Source: ABdhPJw7A0y3fyK7L18X3zyTA6w3Igd89jXf6Bt27qF0LfWbZibjx158ZY+PpiFXEM3FQyB/86Fd+r9ZgzutK6wGHYA=
X-Received: by 2002:a1c:b78a:: with SMTP id h132mr2584886wmf.172.1602067033969; 
 Wed, 07 Oct 2020 03:37:13 -0700 (PDT)
MIME-Version: 1.0
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN>
In-Reply-To: <87y2kisawy.fsf@HIDDEN>
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Wed, 7 Oct 2020 12:37:02 +0200
Message-ID: <CAG7BpaqRnyJ7NZw5ayCmqMxYHh2XLTNCSoMkyYE03qWSVGB9gg@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
To: Juri Linkov <juri@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000007757bb05b1124c1a"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000007757bb05b1124c1a
Content-Type: text/plain; charset="UTF-8"

> All these problems are because of mismatch between your X layout and
> your Emacs input method.  Emacs doesn't know the X layout, so you need
> to define it in Emacs by adapting an existing input method,
> or defining different keys manually.

Sorry, I don't understand. I also don't see anything about this in the
documentation (README).

I want physical key that is '/' in English to type '.' in Russian (because
that is what it does in russian-computer), but invoke shortcuts bound to
C-/, M-/ etc. Is that possible with `reverse-im'?

Paul


On Wed, 7 Oct 2020 at 10:43, Juri Linkov <juri@HIDDEN> wrote:

> >> When your X xkb layout has some differences from an Emacs input method,
> >> you need to adjust these mismatched keys, but this is not a big problem.
> >
> > It doesn't. With switching Emacs input methods between English and
> Russian
> > I also get English '/' == Russian '.'. And so C-. in Russian input method
> > works
> > as C-/ in English, because it's the same physical key.
> >
> > Also, the same goes for many S-M-[digit] combinations, because characters
> > on the digit row are often different in Russian layout. For example,
> S-M-6
> > in
> > English layout translates to M-^, `delete-indentation', but in Russian
> > S-M-6
> > becomes M-:, `eval-expression'. And so on.
>
> All these problems are because of mismatch between your X layout and
> your Emacs input method.  Emacs doesn't know the X layout, so you need
> to define it in Emacs by adapting an existing input method,
> or defining different keys manually.
>
> > So, it is a good workaround that *mostly* works. But it doesn't solve the
> > underlying issue. Which was successfully solved by other applications
> tens
> > of years ago.
>
> We already discussed this 10 years ago, and the conclusion was that
> it would require too fundamental changes in how Emacs processes keystrokes.
>
> If now you have new ideas about how this would be possible to implement
> by keeping backward-compatibility of the existing design,
> patches that demonstrate the ideas are welcome.
>

--0000000000007757bb05b1124c1a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; All these problems are because of mismatch between yo=
ur X layout and<br>&gt; your Emacs input method.=C2=A0 Emacs doesn&#39;t kn=
ow the X layout, so you need<br>&gt; to define it in Emacs by adapting an e=
xisting input method,<br>&gt; or defining different keys manually.<br><div>=
<br></div><div>Sorry, I don&#39;t understand. I also don&#39;t see anything=
 about this in the</div><div>documentation (README).</div><div><br></div><d=
iv>I want physical key that is &#39;/&#39; in English to type &#39;.&#39; i=
n Russian (because</div><div>that is what it does in russian-computer), but=
 invoke shortcuts bound to</div><div>C-/, M-/ etc. Is that possible with `r=
everse-im&#39;?</div><div><br></div><div>Paul</div><div><br></div></div><br=
><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, 7=
 Oct 2020 at 10:43, Juri Linkov &lt;<a href=3D"mailto:juri@HIDDEN">juri=
@linkov.net</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">&gt;&gt; When your X xkb layout has some differences from an Ema=
cs input method,<br>
&gt;&gt; you need to adjust these mismatched keys, but this is not a big pr=
oblem.<br>
&gt;<br>
&gt; It doesn&#39;t. With switching Emacs input methods between English and=
 Russian<br>
&gt; I also get English &#39;/&#39; =3D=3D Russian &#39;.&#39;. And so C-. =
in Russian input method<br>
&gt; works<br>
&gt; as C-/ in English, because it&#39;s the same physical key.<br>
&gt;<br>
&gt; Also, the same goes for many S-M-[digit] combinations, because charact=
ers<br>
&gt; on the digit row are often different in Russian layout. For example, S=
-M-6<br>
&gt; in<br>
&gt; English layout translates to M-^, `delete-indentation&#39;, but in Rus=
sian<br>
&gt; S-M-6<br>
&gt; becomes M-:, `eval-expression&#39;. And so on.<br>
<br>
All these problems are because of mismatch between your X layout and<br>
your Emacs input method.=C2=A0 Emacs doesn&#39;t know the X layout, so you =
need<br>
to define it in Emacs by adapting an existing input method,<br>
or defining different keys manually.<br>
<br>
&gt; So, it is a good workaround that *mostly* works. But it doesn&#39;t so=
lve the<br>
&gt; underlying issue. Which was successfully solved by other applications =
tens<br>
&gt; of years ago.<br>
<br>
We already discussed this 10 years ago, and the conclusion was that<br>
it would require too fundamental changes in how Emacs processes keystrokes.=
<br>
<br>
If now you have new ideas about how this would be possible to implement<br>
by keeping backward-compatibility of the existing design,<br>
patches that demonstrate the ideas are welcome.<br>
</blockquote></div>

--0000000000007757bb05b1124c1a--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 7 Oct 2020 08:51:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 07 04:51:18 2020
Received: from localhost ([127.0.0.1]:55215 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kQ5AM-0000N5-L5
	for submit <at> debbugs.gnu.org; Wed, 07 Oct 2020 04:51:18 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45500)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kQ5AH-0000Ml-Q3
 for 43830 <at> debbugs.gnu.org; Wed, 07 Oct 2020 04:51:17 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:41968)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kQ5AB-0003kQ-Cl; Wed, 07 Oct 2020 04:51:07 -0400
Received: from [176.228.60.248] (port=4873 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kQ5AA-0000Rs-Lk; Wed, 07 Oct 2020 04:51:07 -0400
Date: Wed, 07 Oct 2020 11:51:12 +0300
Message-Id: <83362qa073.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87y2kisawy.fsf@HIDDEN> (message from Juri Linkov on
 Wed, 07 Oct 2020 11:16:12 +0300)
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 <87y2kisawy.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org, pogonyshev@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Juri Linkov <juri@HIDDEN>
> Date: Wed, 07 Oct 2020 11:16:12 +0300
> Cc: 43830 <at> debbugs.gnu.org
> 
> > So, it is a good workaround that *mostly* works. But it doesn't solve the
> > underlying issue. Which was successfully solved by other applications tens
> > of years ago.
> 
> We already discussed this 10 years ago, and the conclusion was that
> it would require too fundamental changes in how Emacs processes keystrokes.

Can you point me to that discussion?

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 7 Oct 2020 08:43:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 07 04:43:30 2020
Received: from localhost ([127.0.0.1]:55195 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kQ52o-0000AO-0N
	for submit <at> debbugs.gnu.org; Wed, 07 Oct 2020 04:43:30 -0400
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:38499)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kQ52l-00009y-LI
 for 43830 <at> debbugs.gnu.org; Wed, 07 Oct 2020 04:43:28 -0400
X-Originating-IP: 91.129.102.160
Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160])
 (Authenticated sender: juri@HIDDEN)
 by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 0F232E0012;
 Wed,  7 Oct 2020 08:43:19 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
Organization: LINKOV.NET
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
 <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
Date: Wed, 07 Oct 2020 11:16:12 +0300
In-Reply-To: <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
 (Paul Pogonyshev's message of "Tue, 6 Oct 2020 23:05:20 +0200")
Message-ID: <87y2kisawy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> When your X xkb layout has some differences from an Emacs input method,
>> you need to adjust these mismatched keys, but this is not a big problem.
>
> It doesn't. With switching Emacs input methods between English and Russian
> I also get English '/' == Russian '.'. And so C-. in Russian input method
> works
> as C-/ in English, because it's the same physical key.
>
> Also, the same goes for many S-M-[digit] combinations, because characters
> on the digit row are often different in Russian layout. For example, S-M-6
> in
> English layout translates to M-^, `delete-indentation', but in Russian
> S-M-6
> becomes M-:, `eval-expression'. And so on.

All these problems are because of mismatch between your X layout and
your Emacs input method.  Emacs doesn't know the X layout, so you need
to define it in Emacs by adapting an existing input method,
or defining different keys manually.

> So, it is a good workaround that *mostly* works. But it doesn't solve the
> underlying issue. Which was successfully solved by other applications tens
> of years ago.

We already discussed this 10 years ago, and the conclusion was that
it would require too fundamental changes in how Emacs processes keystrokes.

If now you have new ideas about how this would be possible to implement
by keeping backward-compatibility of the existing design,
patches that demonstrate the ideas are welcome.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 6 Oct 2020 21:05:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 06 17:05:40 2020
Received: from localhost ([127.0.0.1]:54271 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kPu9T-0001dV-OR
	for submit <at> debbugs.gnu.org; Tue, 06 Oct 2020 17:05:40 -0400
Received: from mail-wm1-f52.google.com ([209.85.128.52]:50892)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kPu9R-0001dH-H5
 for 43830 <at> debbugs.gnu.org; Tue, 06 Oct 2020 17:05:38 -0400
Received: by mail-wm1-f52.google.com with SMTP id 13so249013wmf.0
 for <43830 <at> debbugs.gnu.org>; Tue, 06 Oct 2020 14:05:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=bfVhaLPDARAtzP4vZ8/xuI31Eh+di9Xrkwmqjld9xjs=;
 b=aK6SmqJuv79nVOK0vkzfojDiXvX/PxcV88B2nITglGXNQWVA4C+L2Q4xcopGiEQVfZ
 wGG7s3l0j5nsYQMsGGMguOrd99GsUCEinn72s7G4jEpl7pbSQ9cJtL2BXXB2OCOqgu+U
 cJyFXGPhynK4v3hoi97hiWHqzOzPErOfkQ2Bue8uM6+csOHDvpE2vtsZoK4l4/M8i2Xw
 Wi5RJ72nqvdGr9nDInXYhYqswEOT6feBF+074bmLsEY4Kq+vXS7SP+tM0WOw5OtQmFJB
 vAOsnLkl7IVuYutXHDghjRHv6rFiu2pbkttVTxHN9WjJERs4p4S5ekDpTFCu4dkjc/l+
 puRQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=bfVhaLPDARAtzP4vZ8/xuI31Eh+di9Xrkwmqjld9xjs=;
 b=A3elRpTzUs4ELf19FlntoNNHA7A0no2U0ZteGqw0IvEvtwBtB6KIDZ7kj9/Q3CM+sU
 rUKWzHfhD3EEqV/uKhkWVfBWvmwQbMFinUBL14yGvgEn59GUe+ByO6mFFhoIm+gKnXcj
 n8obYeebdgN6umM/sqP7zAEy0gpBq/Hb27UmveaJc/WUGqP2JQtMQI0FbkiI5UjuwzlP
 yTCZ+lG24lnjYi1qN8uMpx8ubTZAdl6Ne8XJz18+wfR/s40zmGsPcP94+mnIs65TR9cp
 iDCypQ+DNT1ByE441r4dv/1BjsnY2UkMqZjNAZyK+KFIeu+U3DG0tfTkv0OsE8WE9s9b
 sO0A==
X-Gm-Message-State: AOAM532sx9g2o3CDdHCODuKRuNPg5m4rKRLP/pZc8F0Dpqb0Sgra6jGw
 yQcmVgHubkxZBJoKuywsiV59RnEKkKJmIZB9+w==
X-Google-Smtp-Source: ABdhPJzzjC1jhMfbaAdpbCEgAhggZTcq8sDngNlHIvpL0gujcJqv+b7fIgyMtIhVI3u2H+Q4Z0VX2WNqCnVgFWfT4v4=
X-Received: by 2002:a1c:98d4:: with SMTP id a203mr7133623wme.83.1602018331671; 
 Tue, 06 Oct 2020 14:05:31 -0700 (PDT)
MIME-Version: 1.0
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 <87imbn2iwm.fsf@HIDDEN>
In-Reply-To: <87imbn2iwm.fsf@HIDDEN>
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Tue, 6 Oct 2020 23:05:20 +0200
Message-ID: <CAG7BpaqrBFUc8e75hADR7xGtPBq0MJma4vaon5+sAE=n3NJYyg@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
To: Juri Linkov <juri@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000953f9905b106f5a9"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000953f9905b106f5a9
Content-Type: text/plain; charset="UTF-8"

> When your X xkb layout has some differences from an Emacs input method,
> you need to adjust these mismatched keys, but this is not a big problem.

It doesn't. With switching Emacs input methods between English and Russian
I also get English '/' == Russian '.'. And so C-. in Russian input method
works
as C-/ in English, because it's the same physical key.

> Hack or not, but it works fine for many users (the git repo has 57 stars).

Yeah, one of those is mine. It doesn't work "fine", it works much better
than
nothing. But still not exactly fine. I rebound C-. as a workaround, because
anyway it has no standard binding. But I cannot do the same for M-. for
example.

Also, the same goes for many S-M-[digit] combinations, because characters
on the digit row are often different in Russian layout. For example, S-M-6
in
English layout translates to M-^, `delete-indentation', but in Russian S-M-6
becomes M-:, `eval-expression'. And so on.

So, it is a good workaround that *mostly* works. But it doesn't solve the
underlying issue. Which was successfully solved by other applications tens
of years ago.

Paul


On Tue, 6 Oct 2020 at 22:37, Juri Linkov <juri@HIDDEN> wrote:

> >> You can use the package https://github.com/a13/reverse-im.el
> >
> > Mostly works fine, but e.g. C-. in Russian doesn't work as C-/ (undo) for
> > me
> > (in Russian layout '.' is on the same key as '/' in English).
>
> When your X xkb layout has some differences from an Emacs input method,
> you need to adjust these mismatched keys, but this is not a big problem.
>
> > Pretty sure the correct way would be for Emacs to support this natively,
> > not hack from Elisp side, which has no information about physical keys,
> > only typed characters.
>
> Hack or not, but it works fine for many users (the git repo has 57 stars).
>

--000000000000953f9905b106f5a9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; When your X xkb layout has some differences from an E=
macs input method,<br>&gt; you need to adjust these mismatched keys, but th=
is is not a big problem.<br><div><br></div><div>It doesn&#39;t. With switch=
ing Emacs input methods between English and Russian</div><div>I also get En=
glish &#39;/&#39; =3D=3D Russian &#39;.&#39;. And so C-. in Russian input m=
ethod works</div><div>as C-/ in English, because it&#39;s the same physical=
 key.</div><div><br></div><div>&gt; Hack or not, but it works fine for many=
 users (the git repo has 57 stars).</div><div><br></div><div>Yeah, one of t=
hose is mine. It doesn&#39;t work &quot;fine&quot;, it works much better th=
an</div><div>nothing. But still not exactly fine. I rebound C-. as a workar=
ound, because</div><div>anyway it has no standard binding. But I cannot do =
the same for M-. for</div><div>example.</div><div><br></div><div>Also, the =
same goes for many S-M-[digit] combinations, because characters</div><div>o=
n the digit row are often different in Russian layout. For example, S-M-6 i=
n</div><div>English layout translates to M-^, `delete-indentation&#39;, but=
 in Russian=C2=A0S-M-6</div><div>becomes M-:, `eval-expression&#39;. And so=
 on.</div><div><br></div><div>So, it is a good workaround that *mostly* wor=
ks. But it doesn&#39;t solve the</div><div>underlying issue. Which was succ=
essfully solved by other applications tens</div><div>of years ago.</div><di=
v><br></div><div>Paul</div><div><br></div></div><br><div class=3D"gmail_quo=
te"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, 6 Oct 2020 at 22:37, Juri=
 Linkov &lt;<a href=3D"mailto:juri@HIDDEN">juri@HIDDEN</a>&gt; wrot=
e:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt;&gt; You =
can use the package <a href=3D"https://github.com/a13/reverse-im.el" rel=3D=
"noreferrer" target=3D"_blank">https://github.com/a13/reverse-im.el</a><br>
&gt;<br>
&gt; Mostly works fine, but e.g. C-. in Russian doesn&#39;t work as C-/ (un=
do) for<br>
&gt; me<br>
&gt; (in Russian layout &#39;.&#39; is on the same key as &#39;/&#39; in En=
glish).<br>
<br>
When your X xkb layout has some differences from an Emacs input method,<br>
you need to adjust these mismatched keys, but this is not a big problem.<br=
>
<br>
&gt; Pretty sure the correct way would be for Emacs to support this nativel=
y,<br>
&gt; not hack from Elisp side, which has no information about physical keys=
,<br>
&gt; only typed characters.<br>
<br>
Hack or not, but it works fine for many users (the git repo has 57 stars).<=
br>
</blockquote></div>

--000000000000953f9905b106f5a9--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 6 Oct 2020 20:37:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 06 16:37:23 2020
Received: from localhost ([127.0.0.1]:54258 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kPti6-0000zc-SX
	for submit <at> debbugs.gnu.org; Tue, 06 Oct 2020 16:37:23 -0400
Received: from relay9-d.mail.gandi.net ([217.70.183.199]:48225)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kPti3-0000zM-WD
 for 43830 <at> debbugs.gnu.org; Tue, 06 Oct 2020 16:37:21 -0400
X-Originating-IP: 91.129.102.160
Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160])
 (Authenticated sender: juri@HIDDEN)
 by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id C00BDFF803;
 Tue,  6 Oct 2020 20:37:12 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
Organization: LINKOV.NET
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
 <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
Date: Tue, 06 Oct 2020 23:34:17 +0300
In-Reply-To: <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
 (Paul Pogonyshev's message of "Tue, 6 Oct 2020 20:59:31 +0200")
Message-ID: <87imbn2iwm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> You can use the package https://github.com/a13/reverse-im.el
>
> Mostly works fine, but e.g. C-. in Russian doesn't work as C-/ (undo) for
> me
> (in Russian layout '.' is on the same key as '/' in English).

When your X xkb layout has some differences from an Emacs input method,
you need to adjust these mismatched keys, but this is not a big problem.

> Pretty sure the correct way would be for Emacs to support this natively,
> not hack from Elisp side, which has no information about physical keys,
> only typed characters.

Hack or not, but it works fine for many users (the git repo has 57 stars).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 6 Oct 2020 18:59:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 06 14:59:51 2020
Received: from localhost ([127.0.0.1]:54176 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kPsBi-00077s-Ow
	for submit <at> debbugs.gnu.org; Tue, 06 Oct 2020 14:59:51 -0400
Received: from mail-wm1-f50.google.com ([209.85.128.50]:39836)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kPsBg-00077g-KL
 for 43830 <at> debbugs.gnu.org; Tue, 06 Oct 2020 14:59:49 -0400
Received: by mail-wm1-f50.google.com with SMTP id d3so4187754wma.4
 for <43830 <at> debbugs.gnu.org>; Tue, 06 Oct 2020 11:59:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=F77TdFhfG0wxCrh24kmsnshAfxz3haw1syPY2tw+ngc=;
 b=NpRKtPqxCPVb7VOpQuiGtlhLLRCTLMeNE8zj09P5xgSP829tuiYbTJT/X6gMVf5f4x
 i401X78ZR9sR4LCiTZmiqGDMVG3fvYZGA19REdmAaVHV9LStEU+nfKEABy4YqCMORRKJ
 0/Lz2M196wWCPz9ukd5qwV9MnXljqA9hV5qdcnOrJkvfEPvOeNpEJdtZRKQPPQ8dObJ9
 2NKTeJ7UBfdI3ox+yiXYS0NrwlpF9A2HPyFSYvEK86AiW/C6PwZlWXKSspTp5VAyRMR+
 /BdeiJWU1PSWSfFephtLXrwsUBNJBWZblu/Yp7L5ozEp56+QBG4e7t9RfQWr2qEnoLZl
 auAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=F77TdFhfG0wxCrh24kmsnshAfxz3haw1syPY2tw+ngc=;
 b=cAjunfrNugUerjeeNPCaKbUn24FO5eUo6LUfa0nt3giOBBgUbCavkauAoD4Xop9N+H
 XRTsmnpln02sKgr4zCtb3qxHCYh2e0rgy/UL7QDjo0W4CLk3/KPTfCQm2LTaGXbyUgyf
 mu+n0Pjk78N87y+5do8acdxwZOqW3+ZVwgxC5CKu+q20LwBhtz2qVIhCrBHm1+iFG/pg
 z9fwP+vaTO+RSzAmuqlRrXeGr9iEXE8t5GapbSy53ULlQUPmGP3ASqAjzxlgm0VNUX+U
 8o5Xoq33TiCyO0wUeiqQ1nW4OIcpsunbin0vJzXcFfbXFJ7SVo/kUdZWrdIXwDIi2gmc
 +kCw==
X-Gm-Message-State: AOAM533EN3Sn+ju8ZePjirzu/e56LDcp2Y6rTRjejTMXDkzV84fF/kNQ
 Ul3yo4xl1kFcakjny9lwsQh9qotbu5n7YmdKPQ==
X-Google-Smtp-Source: ABdhPJxybd7O0w8on7mASHIIQ0Q65GBpF5wZHYrY5QDL3jbJQ04KKkdG1kzsh4ejo5AVpGOXazOnLCx9Kq2S9KmMk60=
X-Received: by 2002:a1c:e444:: with SMTP id b65mr5911930wmh.147.1602010782645; 
 Tue, 06 Oct 2020 11:59:42 -0700 (PDT)
MIME-Version: 1.0
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <87h7r78a5y.fsf@HIDDEN>
In-Reply-To: <87h7r78a5y.fsf@HIDDEN>
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Tue, 6 Oct 2020 20:59:31 +0200
Message-ID: <CAG7BpapC3rnBF=1aD_acOFwY=q37Q68dwKAZZWAd_dS=Wuqb6A@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
To: Juri Linkov <juri@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000a0402205b1053381"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000a0402205b1053381
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

> You can use the package https://github.com/a13/reverse-im.el

Mostly works fine, but e.g. C-. in Russian doesn't work as C-/ (undo) for m=
e
(in Russian layout '.' is on the same key as '/' in English).

Pretty sure the correct way would be for Emacs to support this natively,
not hack from Elisp side, which has no information about physical keys,
only typed characters.

> your previous request some years ago

Must be more than 10 years ago I guess, I used to type some Russian
text back then.

Paul


On Tue, 6 Oct 2020 at 20:47, Juri Linkov <juri@HIDDEN> wrote:

> > I use English and Russian keyboard layouts. For every single applicatio=
n
> I
> > don't need to care which layout is currently selected for shortcuts, e.=
g.
> > Ctrl+S and Ctrl+=D0=AB do the same (S and =D0=AB are on the same physic=
al key). Of
> > course, in Emacs it doesn't work this way: C-s triggers Isearch, but C-=
=D1=8B
> > "is undefined".
>
> You can use the package https://github.com/a13/reverse-im.el
> that was created from code that I wrote to address your previous request
> some years ago.
>

--000000000000a0402205b1053381
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; You can use the package=C2=A0<a href=3D"https://githu=
b.com/a13/reverse-im.el" rel=3D"noreferrer" target=3D"_blank">https://githu=
b.com/a13/reverse-im.el</a><div><br></div><div>Mostly works fine, but e.g. =
C-. in Russian doesn&#39;t work as C-/ (undo) for me</div><div>(in Russian =
layout &#39;.&#39; is on the same key as &#39;/&#39; in English).</div><div=
><br></div><div>Pretty sure the correct way would be for Emacs to support t=
his natively,</div><div>not hack from Elisp side, which has no information =
about physical keys,</div><div>only typed characters.</div><div><br></div><=
div>&gt; your previous request some years ago<br></div><div><br></div><div>=
Must be more than 10 years ago I guess, I used to type some Russian</div><d=
iv>text back then.</div><div><br></div><div>Paul</div><div><br></div></div>=
<br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Tue=
, 6 Oct 2020 at 20:47, Juri Linkov &lt;<a href=3D"mailto:juri@HIDDEN">j=
uri@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex">&gt; I use English and Russian keyboard layouts. For every si=
ngle application I<br>
&gt; don&#39;t need to care which layout is currently selected for shortcut=
s, e.g.<br>
&gt; Ctrl+S and Ctrl+=D0=AB do the same (S and =D0=AB are on the same physi=
cal key). Of<br>
&gt; course, in Emacs it doesn&#39;t work this way: C-s triggers Isearch, b=
ut C-=D1=8B<br>
&gt; &quot;is undefined&quot;.<br>
<br>
You can use the package <a href=3D"https://github.com/a13/reverse-im.el" re=
l=3D"noreferrer" target=3D"_blank">https://github.com/a13/reverse-im.el</a>=
<br>
that was created from code that I wrote to address your previous request<br=
>
some years ago.<br>
</blockquote></div>

--000000000000a0402205b1053381--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 6 Oct 2020 18:47:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 06 14:47:31 2020
Received: from localhost ([127.0.0.1]:54152 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kPrzn-0006kx-5q
	for submit <at> debbugs.gnu.org; Tue, 06 Oct 2020 14:47:31 -0400
Received: from relay11.mail.gandi.net ([217.70.178.231]:56133)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kPrzm-0006fQ-8Q
 for 43830 <at> debbugs.gnu.org; Tue, 06 Oct 2020 14:47:30 -0400
Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160])
 (Authenticated sender: juri@HIDDEN)
 by relay11.mail.gandi.net (Postfix) with ESMTPSA id 23AE3100002;
 Tue,  6 Oct 2020 18:47:22 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of
 the OS
Organization: LINKOV.NET
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
Date: Tue, 06 Oct 2020 21:46:33 +0300
In-Reply-To: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 (Paul Pogonyshev's message of "Tue, 6 Oct 2020 17:34:34 +0200")
Message-ID: <87h7r78a5y.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> I use English and Russian keyboard layouts. For every single application I
> don't need to care which layout is currently selected for shortcuts, e.g.
> Ctrl+S and Ctrl+ù do the same (S and ù are on the same physical key). Of
> course, in Emacs it doesn't work this way: C-s triggers Isearch, but C-Ù
> "is undefined".

You can use the package https://github.com/a13/reverse-im.el
that was created from code that I wrote to address your previous request
some years ago.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 6 Oct 2020 18:00:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 06 14:00:33 2020
Received: from localhost ([127.0.0.1]:54087 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kPrGK-0003bI-QA
	for submit <at> debbugs.gnu.org; Tue, 06 Oct 2020 14:00:33 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43558)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kPrGH-0003b4-Ik
 for 43830 <at> debbugs.gnu.org; Tue, 06 Oct 2020 14:00:31 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:56575)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kPrGA-0002CK-7L; Tue, 06 Oct 2020 14:00:24 -0400
Received: from [176.228.60.248] (port=1995 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kPrG9-0000g7-Er; Tue, 06 Oct 2020 14:00:22 -0400
Date: Tue, 06 Oct 2020 21:00:25 +0300
Message-Id: <83pn5v9qva.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
In-Reply-To: <CAG7BpapZQKVAN9iHzi4ofd0Gh6j_xB37ncKRH1Q1jQjKeGM1ww@HIDDEN>
 (message from Paul Pogonyshev on Tue, 6 Oct 2020 19:48:05 +0200)
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <83r1qb9sgl.fsf@HIDDEN>
 <CAG7BpapZQKVAN9iHzi4ofd0Gh6j_xB37ncKRH1Q1jQjKeGM1ww@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Paul Pogonyshev <pogonyshev@HIDDEN>
> Date: Tue, 6 Oct 2020 19:48:05 +0200
> Cc: 43830 <at> debbugs.gnu.org
> 
> > Do you know how to retrieve the key code corresponding to the English
> > keyboard layout when the active layout is something else, like
> > Russian?
> 
> No, but there must be a way, because both GTK+ and KDE know how to do
> this. GTK+ also can do this when run under KDE, so I'm pretty sure the
> information itself comes from X (xkb), not e.g. from GNOME configuration.

Then I guess we will have to wait for someone who could explain how
this can be done in Emacs.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 6 Oct 2020 17:48:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 06 13:48:24 2020
Received: from localhost ([127.0.0.1]:54083 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kPr4a-0003Jp-Ed
	for submit <at> debbugs.gnu.org; Tue, 06 Oct 2020 13:48:24 -0400
Received: from mail-wm1-f53.google.com ([209.85.128.53]:33716)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kPr4Y-0003Jb-EK
 for 43830 <at> debbugs.gnu.org; Tue, 06 Oct 2020 13:48:22 -0400
Received: by mail-wm1-f53.google.com with SMTP id z22so2754791wmi.0
 for <43830 <at> debbugs.gnu.org>; Tue, 06 Oct 2020 10:48:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=tyXCOsNDZ0Z5br9Um4qZbf6Xv91SS7NuZbO5Dphh6j4=;
 b=gus5narMPpLK5PTV/IdH44JOm5U81iIf+NVSx2EvugxS/aNkJA2AY6zFoqWAgSy7S3
 hVm5uYIi6v4Q6XViBrt1vXjXhYQ4HZtx/IEQgbjzk3IUJwhiwqqJDGVcxRvFghplifAP
 vR+f3kYj50ocJaKm7cmPpWd//4oC0E/vMviGgOW5nYtDEO6cef18y0N3xbxHPusJAzUq
 80HODBRK1XhHE++5qDhFxZ4GjNTTELvOBe5FBwA+a/9G/bpq4i+b/htDWaOMOsAbaERX
 UX1ru2NnyV1h+MKwMTTMbwHqNVui26Ya3nkaNPld9eiXgNyom2v/M/sEGQm+wruq7/Ya
 1tLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=tyXCOsNDZ0Z5br9Um4qZbf6Xv91SS7NuZbO5Dphh6j4=;
 b=GRW8DpObwhOOwb6uJT92xLWwJTw6NljWR2kuoS90NFvGXhaCJWRPEMQBlRjDIXdbWZ
 hYemfrhCZK7kYBIIGWv1jFoeOxwvCB7ZTDkhaCrexyfRgZm3n/52yQczhhAebv9O0Vup
 VsfusH0OjOTVjgnkLy0RbSg4RM/hIBC8Z//XcZjnndcxQW2ExyJuf/W/aOYDNavxHdV7
 UZdFNABlPGFwzeU9wCdeV6ilt72bFxiPO/2/QUu1IAkp2QwskmR14ujAlOU726YnO9Li
 za3HcmTetIKts/6F+VxBqZwFyFsZ8PogjBA/3+ZwUp71dRVeM7VPTZzfqOwV9BVlAwna
 ueIA==
X-Gm-Message-State: AOAM532ID8y+zjR1fGAbgGqOLLvc6lfcY0g1kXdO1Qum4IUj9SK1hkaB
 UpP2Y+Mx5MhgzAzuXL4Vhh2VvgEJucbbWGjTcA==
X-Google-Smtp-Source: ABdhPJxDq2I7pGTspe9GMUxmb0TU0LfMq7iQWHMmGBjr2t3hyW7LMUTwKtcRBEUKJ/0oVoehy67Ek0MEqOj0yZqVaZk=
X-Received: by 2002:a7b:c081:: with SMTP id r1mr6011075wmh.158.1602006496402; 
 Tue, 06 Oct 2020 10:48:16 -0700 (PDT)
MIME-Version: 1.0
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 <83r1qb9sgl.fsf@HIDDEN>
In-Reply-To: <83r1qb9sgl.fsf@HIDDEN>
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Tue, 6 Oct 2020 19:48:05 +0200
Message-ID: <CAG7BpapZQKVAN9iHzi4ofd0Gh6j_xB37ncKRH1Q1jQjKeGM1ww@HIDDEN>
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="00000000000025614a05b1043426"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--00000000000025614a05b1043426
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

> Do you know how to retrieve the key code corresponding to the English
> keyboard layout when the active layout is something else, like
> Russian?

No, but there must be a way, because both GTK+ and KDE know how to do
this. GTK+ also can do this when run under KDE, so I'm pretty sure the
information itself comes from X (xkb), not e.g. from GNOME configuration.
No idea about the other way round, but I guess it also works.

> Or maybe the keyboard driver can be configured to return ASCII
> characters when the Ctrl key is held, even when the layout is
> non-English?

Not sure what you mean here, but certainly it doesn't need to be configured
by the user. Maybe by the application/framework (i.e. KDE, GTK+ or Emacs).

> A workaround is to bind C-=D1=8B to the same command as C-s (and similarl=
y
> with other combinations that matter).

This is not feasible because Emacs has hundreds of shortcuts coming from
all sorts of places (the core, major and minor modes, my config and so on).
It's certainly not just about C-s.

By the way, same goes for shortcuts/keybindings even without modifiers.
E.g. I have my own keybinding <f12 s> to switch to *scratch* buffer.
<f12 =D1=8B> is, predictably, "undefined". However, if using Emacs' own Rus=
sian
input method, it works just like <f12 s>, even though the key on itself
types "=D1=8B".

Paul

On Tue, 6 Oct 2020 at 19:26, Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Paul Pogonyshev <pogonyshev@HIDDEN>
> > Date: Tue, 6 Oct 2020 17:34:34 +0200
> >
> > I use English and Russian keyboard layouts. For every single applicatio=
n
> I don't need to care which layout is
> > currently selected for shortcuts, e.g. Ctrl+S and Ctrl+=D0=AB do the sa=
me (S
> and =D0=AB are on the same physical
> > key). Of course, in Emacs it doesn't work this way: C-s triggers
> Isearch, but C-=D1=8B "is undefined".
>
> Do you know how to retrieve the key code corresponding to the English
> keyboard layout when the active layout is something else, like
> Russian?  Does someone else here know?
>
> Or maybe the keyboard driver can be configured to return ASCII
> characters when the Ctrl key is held, even when the layout is
> non-English?
>
> What Emacs does, AFAICT, when a key press event comes in is call the
> Xlib function that returns the character produced by the keyboard, and
> that character depends on the current keyboard layout.  We then add
> the modifier keys to that character.  I don't see the "original"
> English-layout character available anywhere in that code, but maybe
> I'm missing something.
>
> A workaround is to bind C-=D1=8B to the same command as C-s (and similarl=
y
> with other combinations that matter).
>

--00000000000025614a05b1043426
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; Do you know how to retrieve the key code correspondin=
g to the English<br>&gt; keyboard layout when the active layout is somethin=
g else, like<br>&gt; Russian?<br><div><br></div><div>No, but there must be =
a way, because both GTK+ and KDE know how to do</div><div>this. GTK+ also c=
an do this when run under KDE, so I&#39;m pretty sure the</div><div>informa=
tion itself comes from X (xkb), not e.g. from GNOME configuration.</div><di=
v>No idea about the other way round, but I guess it also works.</div><div><=
br></div><div>&gt; Or maybe the keyboard driver can be configured to return=
 ASCII<br>&gt; characters when the Ctrl key is held, even when the layout i=
s<br>&gt; non-English?<br></div><div><br></div><div>Not sure what you mean =
here, but certainly it doesn&#39;t need to be configured</div><div>by the u=
ser. Maybe by the application/framework (i.e. KDE, GTK+ or Emacs).</div><di=
v><br></div><div>&gt; A workaround is to bind C-=D1=8B to the same command =
as C-s (and similarly</div>&gt; with other combinations that matter).<div><=
br></div><div>This is not feasible because Emacs has hundreds of shortcuts =
coming from</div><div>all sorts of places (the core, major and minor modes,=
 my config and so on).</div><div>It&#39;s certainly not just about C-s.</di=
v><div><br></div><div>By the way, same goes for shortcuts/keybindings even =
without modifiers.</div><div>E.g. I have my own keybinding &lt;f12 s&gt; to=
 switch to *scratch* buffer.</div><div>&lt;f12 =D1=8B&gt; is, predictably, =
&quot;undefined&quot;. However, if using Emacs&#39; own Russian</div><div>i=
nput method, it works just like &lt;f12 s&gt;, even though the key on itsel=
f</div><div>types &quot;=D1=8B&quot;.</div><div><br></div><div>Paul<br></di=
v></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr=
">On Tue, 6 Oct 2020 at 19:26, Eli Zaretskii &lt;<a href=3D"mailto:eliz@gnu=
.org">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote=
" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);=
padding-left:1ex">&gt; From: Paul Pogonyshev &lt;<a href=3D"mailto:pogonysh=
ev@HIDDEN" target=3D"_blank">pogonyshev@HIDDEN</a>&gt;<br>
&gt; Date: Tue, 6 Oct 2020 17:34:34 +0200<br>
&gt; <br>
&gt; I use English and Russian keyboard layouts. For every single applicati=
on I don&#39;t need to care which layout is<br>
&gt; currently selected for shortcuts, e.g. Ctrl+S and Ctrl+=D0=AB do the s=
ame (S and =D0=AB are on the same physical<br>
&gt; key). Of course, in Emacs it doesn&#39;t work this way: C-s triggers I=
search, but C-=D1=8B &quot;is undefined&quot;.<br>
<br>
Do you know how to retrieve the key code corresponding to the English<br>
keyboard layout when the active layout is something else, like<br>
Russian?=C2=A0 Does someone else here know?<br>
<br>
Or maybe the keyboard driver can be configured to return ASCII<br>
characters when the Ctrl key is held, even when the layout is<br>
non-English?<br>
<br>
What Emacs does, AFAICT, when a key press event comes in is call the<br>
Xlib function that returns the character produced by the keyboard, and<br>
that character depends on the current keyboard layout.=C2=A0 We then add<br=
>
the modifier keys to that character.=C2=A0 I don&#39;t see the &quot;origin=
al&quot;<br>
English-layout character available anywhere in that code, but maybe<br>
I&#39;m missing something.<br>
<br>
A workaround is to bind C-=D1=8B to the same command as C-s (and similarly<=
br>
with other combinations that matter).<br>
</blockquote></div>

--00000000000025614a05b1043426--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at 43830 <at> debbugs.gnu.org:


Received: (at 43830) by debbugs.gnu.org; 6 Oct 2020 17:26:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 06 13:26:13 2020
Received: from localhost ([127.0.0.1]:54055 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kPqj6-0002kX-2S
	for submit <at> debbugs.gnu.org; Tue, 06 Oct 2020 13:26:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:36622)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kPqj0-0002jz-BV
 for 43830 <at> debbugs.gnu.org; Tue, 06 Oct 2020 13:26:10 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:55877)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kPqiv-0006bL-3Z; Tue, 06 Oct 2020 13:26:01 -0400
Received: from [176.228.60.248] (port=3865 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kPqiu-0001XC-AB; Tue, 06 Oct 2020 13:26:00 -0400
Date: Tue, 06 Oct 2020 20:26:02 +0300
Message-Id: <83r1qb9sgl.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Pogonyshev <pogonyshev@HIDDEN>
In-Reply-To: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
 (message from Paul Pogonyshev on Tue, 6 Oct 2020 17:34:34 +0200)
Subject: Re: bug#43830: keyboard layout handling incompatible with rest of the
 OS
References: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43830
Cc: 43830 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Paul Pogonyshev <pogonyshev@HIDDEN>
> Date: Tue, 6 Oct 2020 17:34:34 +0200
> 
> I use English and Russian keyboard layouts. For every single application I don't need to care which layout is
> currently selected for shortcuts, e.g. Ctrl+S and Ctrl+Ы do the same (S and Ы are on the same physical
> key). Of course, in Emacs it doesn't work this way: C-s triggers Isearch, but C-Ñ‹ "is undefined".

Do you know how to retrieve the key code corresponding to the English
keyboard layout when the active layout is something else, like
Russian?  Does someone else here know?

Or maybe the keyboard driver can be configured to return ASCII
characters when the Ctrl key is held, even when the layout is
non-English?

What Emacs does, AFAICT, when a key press event comes in is call the
Xlib function that returns the character produced by the keyboard, and
that character depends on the current keyboard layout.  We then add
the modifier keys to that character.  I don't see the "original"
English-layout character available anywhere in that code, but maybe
I'm missing something.

A workaround is to bind C-Ñ‹ to the same command as C-s (and similarly
with other combinations that matter).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Oct 2020 15:34:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 06 11:34:58 2020
Received: from localhost ([127.0.0.1]:53923 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kPozS-0006H6-3g
	for submit <at> debbugs.gnu.org; Tue, 06 Oct 2020 11:34:58 -0400
Received: from lists.gnu.org ([209.51.188.17]:37118)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pogonyshev@HIDDEN>) id 1kPozN-0006Gq-0d
 for submit <at> debbugs.gnu.org; Tue, 06 Oct 2020 11:34:57 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45818)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <pogonyshev@HIDDEN>)
 id 1kPozK-00045R-Dt
 for bug-gnu-emacs@HIDDEN; Tue, 06 Oct 2020 11:34:51 -0400
Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:45900)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <pogonyshev@HIDDEN>)
 id 1kPozI-0006qn-Cl
 for bug-gnu-emacs@HIDDEN; Tue, 06 Oct 2020 11:34:50 -0400
Received: by mail-wr1-x42f.google.com with SMTP id e17so5286970wru.12
 for <bug-gnu-emacs@HIDDEN>; Tue, 06 Oct 2020 08:34:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=ckmF1GQ28dPCMJ7Z1xv+Gy/eosQ1IWxDs5MqCfxQ868=;
 b=bZlpw/sn4XIr8lnElsy3QVdr0yKJv4fXZlgH2GkHeNWZ1O4D8jmjtKz9zZLHpCyYDv
 A5yxomc+6GfRvbLQBCHak4JyPpBxOpav8fnfw0bFMoTsF8lkaNh3/2v9tBt3AqOCf78o
 46vwHakyG18p2GfKhY96mpvkBxS7/5hV1ayIyOWrNkgN9b4+a3v/6k9pENwJIP4v1l8Q
 hWsyFOmUqp346fz6yJyyAAs+Sy8dlmnpPACR2ds7gUPz7gPBFunYlzCck5dMJ866xZUV
 UY43Ob2yGGVgCzz1jrYY53zR6GPd7tfvc61lqlp8BAjBbYPWMuKQbC6vu8ZrRAYFAd3n
 Iqhg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=ckmF1GQ28dPCMJ7Z1xv+Gy/eosQ1IWxDs5MqCfxQ868=;
 b=bQCLW1ze88Yv+YYS8wruGYcfoZJWllTUDmf/dN5NaNubYUNurz3QCxtGE7TIesiu/8
 qPtjYa0mZ5VMqysqeCvt7VNRLaXOtcKYR0o0W4NFy/p1fqM6QL31do1OkmKqKytAliXw
 SPJzalxKE8OfsJFCILZ7mfbeLQygIO/8kUtwUKZGuOKMVehZMUmVK+a3Zp1Zp6wMLEwk
 V5Dys+n03pnH/PfhX5g3LasU3tY20tGmIitz4sk5eQr+hZ16uXMxfLtX1iRrXBMV387s
 dI3XdQg+w9JruKc1/XQOgmQeKZqVpQRXKOpmKFjJmpRd48A2tYRzLkEsXMZkVlgZzSEH
 Vdow==
X-Gm-Message-State: AOAM530F2RF7yN/xRDRhD6uOIKDU9dXBUq6sx4H1y+GpM8FxGIr2olSK
 64HSwlNszmTfTiv0gtiv36mXeB8mNTsB/7TMtDBcdxk=
X-Google-Smtp-Source: ABdhPJwgmVHCXOJnsbTEnO8V3VVecTG1ELsTxANQo4e8+xiO/VlmumFmzk5T8f/qj/XWGxUPKX/0bR6OKuwFm3Id5O4=
X-Received: by 2002:a5d:568a:: with SMTP id f10mr1071304wrv.30.1601998485760; 
 Tue, 06 Oct 2020 08:34:45 -0700 (PDT)
MIME-Version: 1.0
From: Paul Pogonyshev <pogonyshev@HIDDEN>
Date: Tue, 6 Oct 2020 17:34:34 +0200
Message-ID: <CAG7BpaoRD2sB9UzH3-cbNMa0hHFeqwXJbRvUkEzgZ4xkmbj0hw@HIDDEN>
Subject: keyboard layout handling incompatible with rest of the OS
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary="000000000000acad4405b102561d"
Received-SPF: pass client-ip=2a00:1450:4864:20::42f;
 envelope-from=pogonyshev@HIDDEN; helo=mail-wr1-x42f.google.com
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
 That's all we know.
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--000000000000acad4405b102561d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I use English and Russian keyboard layouts. For every single application I
don't need to care which layout is currently selected for shortcuts, e.g.
Ctrl+S and Ctrl+=D0=AB do the same (S and =D0=AB are on the same physical k=
ey). Of
course, in Emacs it doesn't work this way: C-s triggers Isearch, but C-=D1=
=8B
"is undefined".

I know that Emacs reinvents the wheel by providing built-in input methods
(switchable by C-\), which does the remapping. However, it is very
user-unfriendly at least for two reasons:

- it is a different key compared to everything else I use; my normal
"Shift+Shift" way of switching keyboard layouts is already part of
mechanical memory and having to use something else is very inconvenient;

- *all* of my configuration for XKB is of course gone if I try using Emacs
input methods; e.g. special handling of the right Alt key (AltGr), which is
very important to quickly type characters only available on English layout.

Paul

--000000000000acad4405b102561d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I use English and Russian keyboard layouts. For every sing=
le application I don&#39;t need to care which layout is currently selected =
for shortcuts, e.g. Ctrl+S and Ctrl+=D0=AB do the same (S and =D0=AB are on=
 the same physical key). Of course, in Emacs it doesn&#39;t work this way: =
C-s triggers Isearch, but C-=D1=8B &quot;is undefined&quot;.<div><br></div>=
<div>I know that Emacs reinvents the wheel by providing built-in input meth=
ods (switchable by C-\), which does the remapping. However, it is very user=
-unfriendly at least for two reasons:</div><div><br></div><div>- it is a di=
fferent key compared to everything else I use; my normal &quot;Shift+Shift&=
quot; way of switching keyboard layouts is already part of mechanical memor=
y and having to use something else is very inconvenient;</div><div><br></di=
v><div>- *all* of my configuration for XKB is of course gone if I try using=
 Emacs input methods; e.g. special handling of the right Alt key (AltGr), w=
hich is very important to quickly type characters only available on English=
 layout.</div><div><br></div><div>Paul</div></div>

--000000000000acad4405b102561d--




Acknowledgement sent to Paul Pogonyshev <pogonyshev@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#43830; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 4 Jul 2021 20:45:01 UTC

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