I have the following code in my
(defun my-foo (arg) (interactive "^p") (message "We got hit") ) (defvar my-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "C-r") 'my-foo) map)) (define-minor-mode my-mode :keymap my-mode-map ()) (defun turn-mode-on () (my-mode +1) ) (define-globalized-minor-mode my-global-mode my-mode turn-mode-on) (my-global-mode t)
In it, I define a global mode with a keymap so that C-r displays the message "We got hit". If I open Emacs's
term and hit C-r in character mode I get the message "We got hit"!
I was under the impression that in character mode Emacs just relays the keys that I press to the shell without interpreting them. Is this not the case? How can I fix this while still maintaining my global keymap?