I'm using prelude mode, and in a file .emacs.d/personal/old-settings.el I have, amongst other things:
(global-set-key (kbd "C-c C-c") 'comment-region)
(add-hook 'c-mode-common-hook
(lambda()
(local-set-key (kbd "C-c o") 'ff-find-other-file)))
Now when editing a c++-mode file, comment-region has been set, but ff-find-other-file hasn't.
I did F1 v c-mode-common-hook and see this:
c-mode-common-hook is a variable defined in `cc-vars.el'.
Its value is ((lambda nil
(local-set-key
(kbd "C-c o")
'ff-find-other-file))
(lambda nil
(run-hooks 'prelude-c-mode-common-hook)))
How would I go about debugging this? There doesn't seem to be a way to list-hooks, detect if the hook had already fired, etc.
C-c C-c
is bound tocomment-region
inc++-mode
by default (against my wishes). BTW,M-;
is the standard global binding to comment a region (usingcomment-dwim
which provides a superset of the functionality ofcomment-region
) and the use ofC-c C-c
for it is an old habit that's mildly discouraged.