Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:
Hadron wrote:
Is it to add a new key binding to be local to a specific mode by adding
a hook e.g
(add-hook 'html-mode-hook
(lambda ()
(local-set-key [f10] 'myfunc)))
or to use define-key on the specific mode-map?e.g
(define-key html-mode-map [f11] 'myfunc)
(assume the html-mode-map variable is instantiated/inscope.
Or to ask another way, why would you choose one over the other and what
might the pitfalls be?
I use the mode hook, because I have an aversion to keymap variable names
:-) and because it doesn't require the package to be loaded.
Makes sense, and doesn't add it multiple times I assume :-;