From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.bugs Subject: bug#43830: keyboard layout handling incompatible with rest of the OS Date: Thu, 8 Oct 2020 15:58:30 +0200 Message-ID: References: <87h7r78a5y.fsf@mail.linkov.net> <87imbn2iwm.fsf@mail.linkov.net> <87y2kisawy.fsf@mail.linkov.net> <83362qa073.fsf@gnu.org> <87blhdrhww.fsf@mail.linkov.net> <83362p85l3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d5d6f305b1293ae7" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4592"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43830@debbugs.gnu.org, Juri Linkov To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 08 15:59:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQWRq-00014P-82 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Oct 2020 15:59:10 +0200 Original-Received: from localhost ([::1]:48758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQWRp-00018Q-8J for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Oct 2020 09:59:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWRi-00018A-VE for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 09:59:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49540) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWRi-0001qg-Ll for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 09:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kQWRi-0006bV-KK for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 09:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Oct 2020 13:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43830 X-GNU-PR-Package: emacs Original-Received: via spool by 43830-submit@debbugs.gnu.org id=B43830.160216553225367 (code B ref 43830); Thu, 08 Oct 2020 13:59:02 +0000 Original-Received: (at 43830) by debbugs.gnu.org; 8 Oct 2020 13:58:52 +0000 Original-Received: from localhost ([127.0.0.1]:32853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQWRX-0006b5-D8 for submit@debbugs.gnu.org; Thu, 08 Oct 2020 09:58:51 -0400 Original-Received: from mail-wr1-f50.google.com ([209.85.221.50]:40389) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQWRU-0006aq-F8 for 43830@debbugs.gnu.org; Thu, 08 Oct 2020 09:58:50 -0400 Original-Received: by mail-wr1-f50.google.com with SMTP id j2so6728430wrx.7 for <43830@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) In-Reply-To: <83362p85l3.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190098 Archived-At: --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 wrote: > > From: Juri Linkov > > Cc: pogonyshev@gmail.com, 43830@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
> The issue is more general than just a single characte= r 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.=C2=A0 Th= erefore, 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.

Probabl= y 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,<= /div>
since I'm very familiar with Java.

B= y the way, what I forgot to mention, is that Emacs input modes
pe= rform 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 bypasse= d.

Paul


<= br>
On Thu,= 8 Oct 2020 at 10:49, Eli Zaretskii <eli= z@gnu.org> wrote:
> From: Juri Linkov <juri@linkov.net>
> Cc: pogonysh= ev@gmail.com,=C2=A0 43830@debbugs.gnu.org
> Date: Wed, 07 Oct 2020 22:01:47 +0300
>
> >> We already discussed this 10 years ago, and the conclusion wa= s that
> >> it would require too fundamental changes in how Emacs process= es keystrokes.
> >
> > Can you point me to that discussion?
>
> https://lists.gnu.org/archi= ve/html/emacs-devel/2005-11/msg01237.html

Thanks.

My take out of that discussion:

=C2=A0. There's a patch in
=C2=A0 =C2=A0https://lists.gnu.o= rg/archive/html/emacs-devel/2005-11/msg01384.html
=C2=A0 =C2=A0which seems to allow what Paul wanted with single characters w= ith
=C2=A0 =C2=A0modifiers, such as C-z or M-s.=C2=A0 That patch has a disadvan= tage that
=C2=A0 =C2=A0it disables AltGr, but if we install that patch as an optional=
=C2=A0 =C2=A0feature, perhaps the disadvantage is not so bad?

=C2=A0. The issue is more general than just a single character with a
=C2=A0 =C2=A0modifier, because key sequences such as "C-x z" will= still not
=C2=A0 =C2=A0work: the 'z' will become the corresponding non-ASCII = character
=C2=A0 =C2=A0when a non-US keyboard layout is used.=C2=A0 Therefore, the on= ly general
=C2=A0 =C2=A0solution is for Emacs to be aware of the keyboard layout in us= e,
=C2=A0 =C2=A0and map the characters internally to their ASCII equivalents u= sing
=C2=A0 =C2=A0that layout.

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