From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.devel,gmane.emacs.xemacs.beta Subject: thoughts on interaction of key bindings and input methods (was Re: wish: right alt/meta to switch keyboard layout while pressed) Date: Sun, 27 Nov 2005 01:01:55 +0200 Message-ID: <200511270101.56195.pogonyshev@gmx.net> References: <200511222150.54248.pogonyshev@gmx.net> <200511261925.20191.pogonyshev@gmx.net> <17288.41589.506361.323637@parhasard.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1133046066 25412 80.91.229.2 (26 Nov 2005 23:01:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 26 Nov 2005 23:01:06 +0000 (UTC) Cc: emacs-devel@gnu.org, XEmacs Beta Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 27 00:00:57 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eg91K-0003Ml-UG for ged-emacs-devel@m.gmane.org; Sat, 26 Nov 2005 23:59:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eg91J-0004kg-Pc for ged-emacs-devel@m.gmane.org; Sat, 26 Nov 2005 17:59:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Eg91A-0004kZ-R6 for emacs-devel@gnu.org; Sat, 26 Nov 2005 17:59:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Eg919-0004kL-Hv for emacs-devel@gnu.org; Sat, 26 Nov 2005 17:59:40 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eg919-0004kI-Eo for emacs-devel@gnu.org; Sat, 26 Nov 2005 17:59:39 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1Eg919-0002xn-EA for emacs-devel@gnu.org; Sat, 26 Nov 2005 17:59:39 -0500 Original-Received: (qmail invoked by alias); 26 Nov 2005 22:59:34 -0000 Original-Received: from unknown (EHLO [194.158.212.235]) [194.158.212.235] by mail.gmx.net (mp021) with SMTP; 26 Nov 2005 23:59:34 +0100 X-Authenticated: #16844820 Original-To: Aidan Kehoe User-Agent: KMail/1.7.2 In-Reply-To: <17288.41589.506361.323637@parhasard.net> Content-Disposition: inline X-Y-GMX-Trusted: 0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:46628 gmane.emacs.xemacs.beta:21233 Archived-At: Aidan Kehoe wrote: >=20 > [CCing XEmacs Beta, because despite it originating at emacs-devel@gnu.org, > this isn=E2=80=99t directly relevant to the FSF=E2=80=99s Emacs any more,= but there=E2=80=99s more > value in keeping it visible than in keeping it in private mail.] OK, I'll also CC it back to GNU Emacs' list for the same reason. > [...] > >=20 > > Sorry, I'm on dial-up and I don't think I want to download megabytes j= ust > > to test it. I use GNU Emacs normally. >=20 > Sure. I hope you don=E2=80=99t mind if I ask you a few specific questions= then -- Sure. > -- If you see M-; listed as a key binding, is the first thing that occurs= to > you to type Alt+Shift+8? Or would you go for Alt+=D0=B6, since =D0=B6 is = where ; is on > the US keyboard? Should we accept both?=20 I can't say which would be the most natural thing to hit, because few apps but Emacs use such extravagant shortcuts. Maybe I'd say like this: if an application uses _localized shortucts_ (i.e. is filled with things like `Ctrl-=D0=A9' and stuff), I'd go for `Alt-Shift-= 8', else `Alt-=D0=B6' i.e. `Alt-;' on English layout. Since Emacs is not localized = in this way (and cannot and mustn't be, I think), typing `M-=D0=B6' for `M-;' is pr= obably more natural. Localized key bindings are impossible for Emacs, since you cannot type say = ']' with the Russian keyboard layout. So, the only option is to type `C-]' as it is on English layout, which implies you must type all the other shortcuts like this, for UI consistency and to avoid clashes. > -- More generally, does this need to be done just for the alphabetic > characters, or does punctuation need to be handled too? Looking at the > Russian key layout, there=E2=80=99s no way to type `, ^, $, so I suspect = you=E2=80=99re > going to answer =E2=80=9Cyes=E2=80=9D to me on that.=20 I cannot answer `yes' to an `or' question ;) Based on what I stated above, I'd say that all shortcuts, in Emacs at least, must be invariant to physical keys, not to logical characters the keys produce with the current input method/layout. This is probably also better ergonomically, since for power users (like me = ;) key binding combos slip into subconsciousness. I don't think my internal autopilot performs a ``hold the Meta key and type the semicolon, wherever it is'' command, rather a ``press the key here with the left thumb, and another one there with the third right finger.'' If it indeed works like that, shortcuts staying at the same physical keys require less effort to memorize/ push into subconsciousness. > -- When I switch to the Russian layout in software, and type C-=D1=87 =D0= =B8 to call > =E2=80=9Cswitch-to-buffer=E2=80=9D , I then need to switch the keyboard l= ayout back if I am > to type *scratch*, which I frequently want to do. Is there a reasonable > thing we can do there that doesn=E2=80=99t make it necessary to switch la= yout?=20 > Accepting =E2=80=9C;=D1=8B=D1=81=D0=BA=D1=84=D0=B5=D1=81=D1=80;=E2=80=9D = as an equivalent buffer name for =E2=80=9C*scratch*=E2=80=9D doesn=E2=80=99t > really seem like a great idea to me; maybe you _wanted_ to create a buffer > with that name. I frequently create buffers named fdlsfdsfds and variatio= ns > on that, for example. Accepting `;=D1=8B=D1=81=D0=BA=D1=84=D0=B5=D1=81=D1=80;' as `*scratch*' won= 't work as a generic solution for the reason you mentioned. It may be an optional heuristic, turned off by default. There were some interesting programs for Windows that would automagically switch the layout for you once you had started typing gibberi= sh in the current layout. I.e. if you typed ``Heccrbq'', it would consider it too weird an English word, backspace it and retype in Russian layout as ``=D0=A0=D1=83=D1=81=D1=81=D0=BA=D0=B8=D0=B9''. Likewise, it would automag= ically switch to English layout if you typed ``=D1=89=D1=87=D0=BD=D1=8C=D1=89=D0=BA=D1=89=D1=82'' instead of `= `oxymoron''. However, such heuristical things often work incorrectly with artificial languages, like programming ones, and must never be forced on the user. The only plausible generic solution I can think of is to track the layout f= or each buffer separately. This may be very difficult to impossible to implement with external layout switching. And that's precisely the reason why I prefer to use Emacs' own input methods switched by `C-\'. This means that I have to use different layout switching methods in Emacs and elsewher= e, but the advantages are more important for me. Another, less important, superiority of Emacs input methods for me is the ability to easily activate an otherwise not used input method. I occasionally activate Greek and German input methods. With Emacs it is relatively simple, while with say KDE it would mean that I'd have to either constantly scroll through 4 layouts or go into the Conrol Center each time I need one of the rarely used layouts. Paul