I'm trying to get emacs (23.3 on Arch Linux) to map Ctrl+F12 to the built-in "compile" function when in C-mode (actually CC-mode, which comes built-in as well). So far I've tried the following:
(defun my-c-mode-common-hook (define-key c-mode-map (kbd "C-<f12>") 'compile))
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
and:
(eval-after-load 'c-mode
'(define-key c-mode-map (kbd "C-<f12>") 'compile))
But neither works; I get <C-f12> is undefined. Based on what I've read here, here, and here, I can't see why it isn't working. Any thoughts?
(eval-after-load)approach seems to work.