Hooks not working
BoSa
chillimac at freenet.de
Fri Dec 20 14:56:11 CET 2013
Hello,
I do have a problem with keybindings defined with evil-define-key
and hooks. According to the documentation, i should use the following
lisp code to enable special bindings for certain modes.
(define-minor-mode evil-neo-org-mode
"Neo+Evil+Org mode"
:init-value nil
:lighter " NeoEvilOrg"
:keymap (make-sparse-keymap))
(evil-define-key 'normal evil-neo-org-mode-map (kbd "TAB") 'org-cycle)
(add-hook 'org-mode-hook 'evil-neo-org-mode)
But the hook won't trigger. If i open some org file, TAB is still
bound to its old command. Only if i switch to the insert state, or
switch back to evil mode by pressing C-z twice, TAB calls the
'org-cycle command. First i thought this is some org mode problem,
but i have the same issue in other modes too. I did another test and
commented out the (evil-mode 1) command in my init file. Thus after
starting emacs and opening an org file, i called (evil-mode)
interactively and then TAB as defined by evil-define-key above
worked as expected.
At the end it seems evil doesn't observe the bindings defined by
evil-defined-key immediately after startup. Only if i reenter some
state they take effect. I have no clue what i'm doing wrong.
Greetings,
Chilli
More information about the implementations-list
mailing list