unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Shahab Shahsavari Alavidjeh <zzgraph@gmail.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Using AltGr as standard modifier key in emacs
Date: Wed, 14 Oct 2015 12:05:18 +0600	[thread overview]
Message-ID: <CAP_d_8W=A4L_ru-snz9RfvpsdsWZr=gLA0b8_RNPH33EjdAJMQ@mail.gmail.com> (raw)
In-Reply-To: <87wpuqzzf7.fsf@fedora22.zzgraph>

On Tue, Oct 13, 2015 at 7:11 PM, Shahab Shahsavari Alavidjeh
<zzgraph@gmail.com> 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’s 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’s 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 — 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-й, but they are ugly,
unreliable, and incomplete. Ideally, it should happen at the
underlying OS integration boundary.



  reply	other threads:[~2015-10-14  6:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-13 13:11 Using AltGr as standard modifier key in emacs Shahab Shahsavari Alavidjeh
2015-10-14  6:05 ` Yuri Khan [this message]
2015-10-14  6:47   ` Shahab Shahsavari Alavidjeh
2015-10-14  9:54   ` tomas
     [not found] ` <mailman.289.1444802784.7904.help-gnu-emacs@gnu.org>
2015-10-14 12:17   ` Rusi
2015-10-15  1:47     ` Rusi
2015-10-15  2:23       ` Yuri Khan
     [not found]       ` <mailman.347.1444875907.7904.help-gnu-emacs@gnu.org>
2015-10-15  2:42         ` Rusi
     [not found] <mailman.229.1444746928.7904.help-gnu-emacs@gnu.org>
2015-10-13 16:57 ` Rusi
2015-10-13 17:05   ` Rusi
2015-10-13 17:44     ` Shahab Shahsavari Alavidjeh
     [not found]     ` <mailman.256.1444758367.7904.help-gnu-emacs@gnu.org>
2015-10-13 18:19       ` Javier
2015-10-13 18:43         ` Javier
2015-10-13 19:42           ` Shahab Shahsavari Alavidjeh
     [not found]           ` <mailman.265.1444765466.7904.help-gnu-emacs@gnu.org>
2015-10-13 20:17             ` Javier
2015-10-14  5:18               ` Shahab Shahsavari Alavidjeh
2015-10-13 19:20         ` Shahab Shahsavari Alavidjeh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP_d_8W=A4L_ru-snz9RfvpsdsWZr=gLA0b8_RNPH33EjdAJMQ@mail.gmail.com' \
    --to=yuri.v.khan@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=zzgraph@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).