reddit / emacs

My Emacs 28 on Ubuntu 20.04 doesn't recognize C-M-p key

daehwannam · 2022-11-04 21:54
I've been used Emacs 27 on Ubuntu 20.04 so far, and tried Emacs 28. However, Emacs 28 doesn't recognize C-M-p key. If I try to find what C-M-p is mapped to via describe-key (C-h k), the emacs simply ignores C-M-p and displays nothing until I type another key. Does anyone know the solution to fix it?
igorepst · 2022-11-04 22:06
https://www.google.com/search?name=f&hl=en&q=ubuntu+ctrl+alt+p You need to find out which application you use that swallows the key combo. For ex., in the first search result some app named Culpit is mentioned
daehwannam · 2022-11-04 23:18
This problem doesn't occur in Emacs 27 but in Emacs 28. In this case, can another application, such as Clipit, steal the key?
thetemp_ · 2022-11-05 01:15
C-M-p works fine on my Emacs 28 install. The first step when you suspect something is wrong with Emacs is to start it with "emacs -Q". This will run it without loading any of your configuration. If you can recreate the problem that way, then you'll know it's not your configuration causing it. Key combinations not being recognized at all are usually the result of an operating system or desktop environment grabbing the keys for its own purposes, which prevents the key from being seen at all by Emacs. There are some unusual configurations that could cause a key combination to be hidden from one version of Emacs and not another (thinking of something like AutoHotKey on Windows). Emphasis on unusual though.
daehwannam · 2022-11-05 02:27
The problem also occurs when I execute "emacs --no-init". As you said, some part of OS would raise it. However, it's still very weird that other applications such as GUI terminal (kitty) or Firefore (tested with vimium) can recognize C-M-p but Emacs 28 can't. I also tested the bug on both GNOME and EXWM, but it always occurs. In addition, I tested Emacs 28.1 installed by apt-get and Emacs 28.2 installed by snap. However, both don't recognize C-M-p.
[deleted] · 2022-11-05 02:30
[deleted]
thetemp_ · 2022-11-05 03:13
Does C-p work? Does ESC work? What happens when you do "C-h k ESC C-p"?
daehwannam · 2022-11-05 03:21
>Does C-p work? C-p works normally. >What happens when you do "C-h k ESC C-p"? It says ```C-M-p (translated from <escape> C-p) runs the command backward-list```. It also recognize C-M-P (C-M-S-p) too, but cannot recognize C-M-p (without shift key).
thetemp_ · 2022-11-05 04:10
So Emacs recognizes that it has a keybinding for C-M-p, but it's either not receiving it or it's translating it to something else. Most likely the former. Another thing you can try if you're on Linux is the "xev" command in a terminal window. It gives you feedback on exactly which keys are being pressed on your keyboard. My best guess is a bad connection or a bad switch for that Alt key going out intermittently or depending on how hard or at which angle you hit it. Edit: actually, a bad "p" key would make more sense.
daehwannam · 2022-11-05 05:48
Thanks for your comments! I would try additional experiments with xev or other tools later.