From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Using AltGr as standard modifier key in emacs Date: Wed, 14 Oct 2015 12:05:18 +0600 Message-ID: References: <87wpuqzzf7.fsf@fedora22.zzgraph> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1444802796 27244 80.91.229.3 (14 Oct 2015 06:06:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Oct 2015 06:06:36 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Shahab Shahsavari Alavidjeh Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 14 08:06:35 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZmFCs-0000xd-Mm for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Oct 2015 08:06:34 +0200 Original-Received: from localhost ([::1]:40639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmFCs-0007Xp-3V for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Oct 2015 02:06:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmFC0-0007Gg-Tn for help-gnu-emacs@gnu.org; Wed, 14 Oct 2015 02:05:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmFBz-0001te-OT for help-gnu-emacs@gnu.org; Wed, 14 Oct 2015 02:05:40 -0400 Original-Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]:35986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmFBz-0001tO-Fx for help-gnu-emacs@gnu.org; Wed, 14 Oct 2015 02:05:39 -0400 Original-Received: by lfeh64 with SMTP id h64so6213057lfe.3 for ; Tue, 13 Oct 2015 23:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=adxmbZVu6IojyVU6LBtWUWOrTGTafDD2migUNRFHU/A=; b=alpdUVMfODVTm3h6PCXpSA1hR17Nr2v0EF+FKwRgzBC3hjuQxXxU+TPaUQWNBmhUXE pRAXP2K0DGWSVg8P4MoKUjBj1EWfxAYigpPRc5JfNPPzZTtxW6sN4xLwtqnN+Tg9p+LF YEZ8QxGVM5WqzozOZKKMktWec6sDhTxgXeliBM3jZTu6MtU02LLwV8NGVcigl3GFMXKq bpat/93EmWLBtVv+7kxmmDI9Sy1ZaUrvdlAAcwZPw5Y51zuvh1x0pf2PFHwEawZwp59i 7MNS0mBoM0AciHjKVGzc7EWxFYHA/jsZZ68c+QYxDSK7Jwmt6GSQU0AuFnZJs9zARz9G vkhw== X-Received: by 10.25.16.92 with SMTP id f89mr383151lfi.1.1444802738315; Tue, 13 Oct 2015 23:05:38 -0700 (PDT) Original-Received: by 10.25.156.131 with HTTP; Tue, 13 Oct 2015 23:05:18 -0700 (PDT) In-Reply-To: <87wpuqzzf7.fsf@fedora22.zzgraph> X-Google-Sender-Auth: 9OgH05gglz2BlUVfvNYICjGYzBE X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c07::236 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107632 Archived-At: On Tue, Oct 13, 2015 at 7:11 PM, Shahab Shahsavari Alavidjeh wrote: > Why I don't simply use my D.E. input method support and keyboard layout > switcher instead? > > I'm currently using it, that's my best option right now, but then I > should switch keyboard layouts whenever I want to run a command in emacs > or even when I want to save a file to disk. I want to expand on Shahab=E2=80=99s description of the problem. 1. Assume a user who works with more than one script (e.g. Latin and Arabic, or Latin and Cyrillic, or Latin and Greek.) Not just occasionally entering non-Latin characters, but actually writing whole words, sentences, paragraphs and chapters in a language using a script other than Latin. 2. Assume also that Emacs is used as an application in a desktop environment, rather than as a desktop environment in and of itself. Assume multiple other applications. (1) is typically facilitated by providing multiple keyboard layouts, called groups in X parlance. Groups are modal, that is, after one group is activated, it remains active until the next switch. It is a matter of user preference whether the active group is global to the desktop or local to each application window. The set of groups is typically kept constant. Emacs provides a similar facility, called input methods. Input methods are typically switched with C-\\, are local to Emacs, and never affect other applications on the desktop. In light of (2), it is desirable that (a) the layouts in Emacs and the desktop environment are identical, (b) the keys to switch layouts are identical, and (c) the scope of layout switching is consistent. All three conditions are easiest satisfied by exclusively using the desktop-provided keyboard layout mechanism and ignoring Emacs input methods completely. (Shahab is asking for a way to emulate the desktop=E2=80=99s layouts using Emacs input methods, but I believe that is = a dead end approach. There should be one, and preferably only one, implementation of keyboard layout mechanism over the whole desktop.) However, this comes at a cost. Because of the way modifiers work in Emacs when running as a GUI application, the user has no way of pressing e.g. C-c or C-x or M-x when a non-Latin layout is active. Instead, Emacs interprets the keypresses as being C- or M-modified letters of the active layout. It would be a great help if modifiers and certain prefixes caused Emacs to ignore the active layout and interpret the base keys according to the primary layout, which will be one of Latin layouts in most cases. (Which exact Latin layout will vary from user to user =E2=80=94= US QWERTY, German QWERTZ, French AZERTY, Dvorak, Colemak, etc.) There are workarounds involving key-translation-map to make Emacs pretend that it got C-q when it gets C-=D0=B9, but they are ugly, unreliable, and incomplete. Ideally, it should happen at the underlying OS integration boundary.