After a few years customizing my .emacs file, I find I used two different kinds of constructs to setup major-mode-specific key bindings:
.emacs
1.
I have lots of custom keyboard commands and I couldn't bother with various ways to set them in Emacs and all these keymaps overriding each other, so I just installed John Wiegley's bind-key as per my relevant answer.
(require 'bind-key) (bind-key "C-l" 'goto-line)