help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: key binding question


From: Kevin Rodgers
Subject: Re: key binding question
Date: Mon, 12 Feb 2007 23:36:44 -0700
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

Hadron wrote:
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 :-;

No need to assume: C-h f add-hook

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

[Prev in Thread] Current Thread [Next in Thread]