From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Nikulin Newsgroups: gmane.emacs.devel Subject: Re: not quite understanding input methods Date: Thu, 2 Sep 2021 19:00:16 +0700 Message-ID: References: <231adc63-77f0-037a-365c-28db98f684cf@piermont.com> <871r686abe.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24582"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 02 14:17:55 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mLlfF-0005zT-2v for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Sep 2021 14:17:53 +0200 Original-Received: from localhost ([::1]:47138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLlfC-0007SF-Cu for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Sep 2021 08:17:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLlOT-0003M5-SC for emacs-devel@gnu.org; Thu, 02 Sep 2021 08:00:33 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:60280) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLlOS-00087o-7H for emacs-devel@gnu.org; Thu, 02 Sep 2021 08:00:33 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mLlOP-0004Bj-Vf for emacs-devel@gnu.org; Thu, 02 Sep 2021 14:00:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-2.225, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:273703 Archived-At: On 01/09/2021 14:43, Yuri Khan wrote: > > My point (which some will find offensive) is that maybe one doesn’t > need to implement input methods in Emacs. I like the idea to avoid input methods in Emacs and to switch keyboard layouts using XKB as in other applications when keycodes may be directly mapped to symbols. Unfortunately Emacs keymaps use current keyboard layout, not base one. E.g. when Russian layout active, key symbols for US locale should be checked. It is terribly inconvenient to switch layout before each shortcut. Control + Cyrillic S does not act as C-c despite it is the same key. That is why switching layouts outside of Emacs still leads to more inconvenience than input methods in Emacs. It was discussed earlier: Keybindings in non-Latin layout https://lists.gnu.org/archive/html/emacs-devel/2009-05/msg00031.html Side note: some iBus input methods have quick way to disable input method, e.g. pressing and releasing Shift. ~15 years ago more Gtk applications suffered from a similar problem that Ctrl+C required namely Latin C, not Cyrillic S. Nowadays I can not name application where Ctrl is broken. For Alt+something the issue is that "something" is locale-dependent and may require switching to RU layout. As to emacs, minor inconvenience: default layout switch Win+Space aka s-SPC aborts incremental search, so customization of key bindings is required. Other issues are significantly harder to overcome. There is reverse-im package that can translate RU symbols back to US ones. Unfortunately it does not work with keystrokes like M-$ or C-c C-, (`org-insert-structure-template') (quail-define-package "russian-computer" ; ... (quail-define-rules ; ... ("," ?б) ; ... ("$" ?\;) ; ... ("?" ?,)) For shortcuts "," should be associated for particular physical key independently of active layout. So it is necessary to ensure at the desktop level that keyboard layout is (almost) never switched for Emacs windows. Preferably the same shortcuts for layout switching should work for all applications, Emacs should not be an exception. I have managed to achieve setup that *mostly* works. CapsLock and Shift+CapsLock select assigned layouts in Emacs and other applications, US layout is forced for Emacs windows. On the other hand I consider it too complex and hardly can recommend it since it is not really robust and has some drawbacks.