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: Tassilo Horn
Subject: Re: Best practice for overriding keybinding of a minor mode?
Date: Fri, 25 Sep 2009 21:30:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

pjb@informatimago.com (Pascal J. Bourguignon) writes:

Hi!

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

Or simply add your bindings to the mode-map.

--8<---------------cut here---------------start------------->8---
;; Unset the default keys
(define-key flyspell-mode-map (kbd "C-.") nil)
(define-key flyspell-mode-map (kbd "C-,") nil)
;; Add the commands to new keys
(define-key flyspell-mode-map (kbd "C-c f .")
            'flyspell-goto-next-error)
(define-key flyspell-mode-map (kbd "C-c f ,")
            'flyspell-auto-correct-word)
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo





reply via email to

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