A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/emacs-evil/evil/issues/301 below:

`evil-define-key' for minor mode does not take effect until a state transition · Issue #301 · emacs-evil/evil · GitHub

Originally reported by: Anonymous

Unit test. (you can change flyspell to any toggleble minor mode)

(require 'flyspell)
(evil-define-key 'normal flyspell-mode-map [f5]
(lambda () (interactive) (message "Hey")))

In scratch buffer

M-x: flyspell-mode

press F5, key is not bound.
press i then esc, key is now bound

This is a problem because evil is enabled from find-file-hook. before major mode specific hooks are called. If major mode specific hooks enable any minor modes, evil is already initialized, and it does not see those minor modes until a state transition is made, so any bindings for them are in-active

Tested with

GNU Emacs 24.3.1 (x86_64-suse-linux-gnu, X toolkit, Xaw scroll bars) of 2013-05-26 on momoland

Evil from git 8f07f5b0b1fc888428b913e14944e89a0341e7b5


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4