I'm trying to adjust bindings in input-decode-map
(to distinguish C-m and RET in GUI mode). None of the advice given on Stack Overflow, gnu.emacs.help, Reddit, or Super User seems to work. I ended up with this:
(defun ~/setup-C-m (&rest args)
(define-key input-decode-map [?\C-m] [C-m]))
(~/setup-C-m)
(add-hook 'tty-setup-hook #'~/setup-C-m)
(add-hook 'window-setup-hook #'~/setup-C-m)
(add-hook 'terminal-init-xterm-hook #'~/setup-C-m)
(add-hook 'after-make-frame-functions #'~/setup-C-m)
Even with all these, starting Emacs with emacsclient --alternate-editor="" --create-frame --frame-parameters="((fullscreen . maximized))"
results in input-decode-map
being set to this:
Value:
(keymap
(27 keymap
(C-backspace)
(C-delete))
(C-M-backspace)
(C-M-delete)
(M-backspace)
(M-delete))
Which doesn't include the C-m
binding. I've printed the value of input-decode-map
when my setup-C-m
function is called, and it's always an empty keymap.
How can I ensure that my setup-C-m
function runs every time I create a frame and properly sets input-decode-map
?
~/
as a prefix for all my personal functions.