In my .emacs file, I want to add a key binding for a specific major mode (setting coffee-compile-file to C-c C-c for coffee-mode). I've found a lot of instructions on using local-set-key and global-set-key, so I can easily add this binding once I've opened a file in coffee-mode, but it would be nice for this to be handled by .emacs.
|
feedback
|
|
Use the mode hook.
| |||
|
feedback
|
|
You can define the key in the mode specific map, something like:
| |||
|
feedback
|