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

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

Re: Best practice for overriding keybinding of a minor mode?


From: Pascal J. Bourguignon
Subject: Re: Best practice for overriding keybinding of a minor mode?
Date: Fri, 25 Sep 2009 10:08:53 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin)

Stefan Kamphausen <skampi@gmx.net> writes:

> Dear all,
>
> whenever you use a minor mode it may come with its own set of
> keybinding.  Just as an example take the keymap of the fine
> flyspell-mode.  It binds C-. and C-, which I find particularly annoying
> since I got those bound to some personal functions globally for years.  
>
> Now, my question is: what is the best/most effective/easiest/suggested
> way to remove those bindings?  Shall I re-create that keymap after
> loading flyspell?  Or override those binding explicitly in all hooks
> where I enable flyspell (mainly nxml and message-mode, that is)?
>
> How would you do this?

There should be a hook run when the minor mode is activated.  You can
put there a function to reinstall your bindings.

In the case of flyspell-mode there is no hook, so you would have to
define an advice on flyspell-mode itself.


-- 
__Pascal Bourguignon__


reply via email to

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