A lot of times I have to change the input language of the keyboard (from English to a different one) causing the problem of the Emacs commands to not be recognized.

Normally when you press Ctrl+A you move to the beginning of the line. When I have a different language than English selected then it says "C-α undefined".

Is there a way to make them independent of the language selected? All editors support this by default so I am sure that there has to be a way.

I am using Ubuntu 16.04 and I installed Emacs through the terminal. It is the 24.5.1 version. I haven't configured the keyboard at all except having included one more language as a possible input.

  • 1
    It sounds like you are changing the keyboard layout outside of Emacs (ie, at the system level). If so, there's nothing Emacs can do about it, since it only sees the keys you send with the alternate layout. You can either redefine a lot of commands for both the English layout and whatever other layout you're using (miserable), or you can use Emacs's input methods like I'd suggested above.
    – Dan
    Mar 3 '17 at 22:24
  • @Dan Isn't this a little weird? Every editor understands the commands no matter which language the keyboard uses and the same goes for every program. It seems to me very peculiar that I have to do something like this.
    – Adam
    Mar 3 '17 at 22:26
  • I guess you expect key bindings to be on the same keys as if you were in a US layout? This is not obviously the right thing — for example, on an AZERTY or Dvorak keyboard, I would not expect Ctrl+key_right_of_caps_lock to go to the beginning of the line. For example, where would you type Alt+; — with the key right of Tab? with the key right of Λ? Mar 3 '17 at 22:29
  • No, I don't think it's weird. Emacs dates back to the 1970s, so there's a lot of functionality that differs from then up to now. It might be a different story if Emacs only had built-in keybindings, but since you can bind anything you want to almost any key combination you please, it's not obvious how to make that a seamless transition. From my experience, the input methods work quite well. I use it frequently, and don't have much cause to complain. (But then I live in Emacs, so I don't have to deal with any other program other than a web browser.)
    – Dan
    Mar 3 '17 at 22:35
  • @Gilles I get that but I don't understand why I have encountered this problem only on Emacs. It seems weird to not do automatically something that every program does by default.
    – Adam
    Mar 3 '17 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.