0

I regularly use the backspace key to delete whole words at a time to the left of the cursor, but this would be a MUCH easier keystroke if it could be done one-handed. For that to happen - I would need to use the right key. But when I do this from EMACS' response it is clearly interpreting this key as being different form the left key.

In this answer the poster identifies a method to achieve this outcome of changing the keymap: https://stackoverflow.com/questions/10257352/right-alt-key-not-working-as-meta-key-in-emacs

I would like to do this by "tweaking" emacs rather than change my keymap in the OS.

Does anybody know how to tell emacs that right alt is the same as left alt?

I am using Windows 10 as my OS

I am accessing EMACS through PUTTY: Release 0.70

onto a Red Hat Enterprise Linux Workstation release 7.6 (Maipo)

EMACS Version: GNU Emacs 24.3.1

This is on my Universities linux Lab - so I am not likely to have a lot of ability to edit config files for EMACS either...

migrated from stackoverflow.com Feb 7 at 0:07

This question came from our site for professional and enthusiast programmers.

  • If Emacs thinks right-alt and left-alt are different, it means the OS passes different information to Emacs depending on which one you use. How to change how Emacs reacts, and whether it is at all possible to do what you want, depends on exactly what the OS is doing. So: what operating system is this? What keyboard layout and settings? And what version of Emacs? – Gilles Feb 6 at 17:52
  • You can get the version with M-x emacs-version. – NickD Feb 7 at 1:41
  • @NickD - Thx - I'e edited in the EMACS & Red Hat versions as well. – kiltannen Feb 7 at 2:21
  • This isn't normal. Some more info would help. First: if the xev program is available on your RedHat computer, run it in a terminal and see what keycode the OS provides for the right and left alt keys. For me I see Alt_R and Alt_L. Then check to see what key codes are passed to Emacs when you press those keys: C-h k M-backspace, using the right and left keys for M. – Tyler Feb 7 at 17:25
  • @Tyler sadly I couldn't get xev. When I followed emacs commands you suggested - I could see the alt_L BUT the right Alt gave nothing at all! I am suspecting a slightly nonstandard scan code that is not being interpreted at all by Emacs :(( So I ended up using keytweak and remapping the key. Not my 1st or even 2nd preference - but it's what got it to work in the end. – kiltannen Feb 19 at 9:55

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.