One of my key bindings is not working on one particular machine and I don't understand why.
On Ubuntu 14.04, with the emacs24
package version 24.3+1-2ubuntu1
, I start emacs -Q
(under X) and run
(global-set-key [(meta backspace)] 'undo)
then press Ctrl+H, c, Alt+BackSpace.
On machine 1, I see as expected that
<M-backspace> runs the command undo
On machine 2, I see
M-DEL (translated from <M-backspace>) runs the command backward-kill-word
The machines are running the same distribution and should be configured pretty much identically. The Emacs packages are the same, yet they react differently even under emacs -Q
.
After a bit of investigation, it turns out that the culprit is input-decode-map
, which on machine 2 contains
(keymap
(27 keymap
(C-backspace .
[27 C-delete])
(C-delete .
[27 C-backspace]))
(C-M-backspace .
[C-M-delete])
(C-M-delete .
[C-M-backspace])
(M-backspace .
[M-delete])
(M-delete .
[M-backspace]))
On machine 1, the keymap contains the same keys, but they're all bound to nil
.
- Why does
input-decode-map
exchange BackSpace and Delete on machine 2? - How do I fix this? I can obviously remove the entries, but there may be terminals where it's warranted; how do I change
input-decode-map
on X11 only (keeping in mind that I do sometimes open terminal and X11 frames in the same instance, so testingwindow-system
in.emacs
isn't good enough)?