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

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

Re: key binding question


From: Hadron
Subject: Re: key binding question
Date: Mon, 12 Feb 2007 10:11:13 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

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


reply via email to

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