Meta-x doesn't work in Emacs
Asked Answered
T

1

6

Problem: How to make Meta-x work in emacs?

Hi I am a newcomer to linux using Ubuntu 10.04LTS and emacs23.1.1. I used the Alt key as Meta, but it stopped working when I upgraded ubuntu. I changed meta to right ctrl (using ubuntu keyboybard preference). Right controll works fine in accesing third level characters in emacs when using Norwegian layout. However typing Meta-x only result in the message "Mismatched parantheses" in emacs and the character '»' in the buffer. Switching to US layout nothing happens when typing meta-x.

I want meta-x to work so I can insert commands again in emacs.

Remedies I have tried:

Changing meta key with ubuntu keyboard preference -> Doesn't work

I looked for the file file .Xdefaults with locate. Since it didn't exist I created it in home\"username". And wrote the line "Xterm*metaSendEscape: true" in the file. (I am not sure what it does. Maybe this is a fix is ment for another problem, I found it at http://www.emacswiki.org/emacs/EmacsChannelFaq#toc17) -> Doesn't work

Transverse answered 24/2, 2011 at 15:8 Comment(2)
I don't know if this will help, but the program xev will tell you exactly what keysyms the X server is receiving when you press keys on your keyboard.Cromer
It seems like your alt key was remapped by the OS upgrade. Do any OS shortcuts with ALT work? For example: Alt+F2 or Alt+Tab?Zygospore
J
11

Normally you could also use the ESC-Key for M-. So M-x would be ESC-x

Johannisberger answered 24/2, 2011 at 15:19 Comment(3)
To be clear, ESC acts as a prefix, not a shift key. In other words, you type ESC then x; you don't type x whie holding down ESC.Mintun
I would keep looking for the source of the problem, however. ESC is a great safety-net, but a lousy replacement meta key.Contrapuntal
@Contrapuntal To be honest: I nearly always use ESC as META. I work with a german keyboard layout and some combinations (e.g. M-{) are quite messy to type with such a layout. But you are correct: It's better to search the source of the problem.Johannisberger

© 2022 - 2024 — McMap. All rights reserved.