> > Evil chooses the initial state for the buffer on the basis on its > major mode (well, it's usually the major mode -- minor modes can > also be configured in this way). Because certain modes jump through > some hoops as part of their initialization, Evil postpones its own > initialization with `post-command-hook'. This only happens once, so > when evaluating (my-switch-to-emacs-state-hook) by hand, after Evil's > initialization is finished, the switch works. > > To set the initial state for a mode, use `evil-set-initial-state'. > Alternatively, you can force the initialization process with an > argument to `evil-initialize-state' (after commit 3b7d2e3): > > (defun my-switch-to-emacs-state-hook () > (when evil-mode (evil-initialize-state 'emacs))) > > This will immediately set the initial state for the buffer, instead > of waiting for `post-command-hook'.
Well, I feel silly. I didn't even try evil-set-initial-state with a minor mode, but it works like a charm. --l _______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
