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: Sun, 1 Nov 2020 19:56:09 +0100 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> <83y2jqcrvn.fsf@gnu.org> <87blghbjpn.fsf@mail.linkov.net> <83blghf0rf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007e785505b3102fe0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33891"; 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 Sun Nov 01 19:57:08 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 1kZIXM-0008hQ-EW for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Nov 2020 19:57:08 +0100 Original-Received: from localhost ([::1]:35256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZIXL-0007Zx-GW for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Nov 2020 13:57:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZIXG-0007Zn-DE for bug-gnu-emacs@gnu.org; Sun, 01 Nov 2020 13:57:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55196) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kZIXG-0006wD-41 for bug-gnu-emacs@gnu.org; Sun, 01 Nov 2020 13:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kZIXG-0000o7-3B for bug-gnu-emacs@gnu.org; Sun, 01 Nov 2020 13:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Nov 2020 18:57: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.16042569893062 (code B ref 43830); Sun, 01 Nov 2020 18:57:02 +0000 Original-Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 18:56:29 +0000 Original-Received: from localhost ([127.0.0.1]:38509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZIWi-0000nK-SV for submit@debbugs.gnu.org; Sun, 01 Nov 2020 13:56:29 -0500 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:45307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZIWh-0000n7-60 for 43830@debbugs.gnu.org; Sun, 01 Nov 2020 13:56:27 -0500 Original-Received: by mail-wr1-f41.google.com with SMTP id a9so12054164wrg.12 for <43830@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) In-Reply-To: <83blghf0rf.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:192436 Archived-At: --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 wrote: > > From: Paul Pogonyshev > > Date: Sun, 1 Nov 2020 17:51:00 +0100 > > Cc: Eli Zaretskii , 43830@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
> read-event will figure out by itself whether it shoul= d return the
> ASCII character or a non-ASCII character, and return t= hat.

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

Paul

On Sun, 1 Nov 2020 at 18:25, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Paul Pogonyshev <pogonyshev@gmail.com>= ;
> Date: Sun, 1 Nov 2020 17:51:00 +0100
> Cc: Eli Zaretskii <eliz@gnu.org>, 43830@debbugs.gnu.org
>
> > > What about functions like `read-event'? It returns integ= ers if I press
> > > M-[letter] or C-[letter].
> >
> > read-event is also implemented in C.=C2=A0 But maybe I don't = understand
> > your question.
>
> I mean, what about the cases where it is called from Elisp?=C2=A0 It i= s
> 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<= br> > 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 nam= ed sth.
> like `last-keybinding-keycode'. Then the caller would use either t= he
> return value (as now) or, if it wants, the value of the variable inste= ad.

What I had in mind was

=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.
--0000000000007e785505b3102fe0--