3
votes

I'm an evil Emacs user. However, I really only use the normal mode for fancy Vim style edits when I find them more convenient than regular Emacs commands. (Mostly fancy bulk editing/yanking/deleting). However, I'm also a huge user of the minibuffer (I do a lot of M-x with ido and flx so I can avoid remembering the more esoteric commands). When I do, evil switches to normal mode automatically after I exit. I find that very annoying/confusing. How can I get it to stop? (preferably in an elegant, non-hackish way).

Thanks, PythonNut

EDIT:

It appears that the switch to normal mode happens in all windows and in all frames.

2
Actually, on inspection. It seems that the switch to normal mode happens when I enter the minibuffer, not when I exit it. The interesting thing is, the contents of minibuffer-setup-hook don't include any evil hooks. it's contents are (minibuffer-depth-setup icicle-minibuffer-setup ido-minibuffer-setup auto-indent-minibuffer-hook rfn-eshadow-setup-minibuffer minibuffer-history-isearch-setup minibuffer-history-initialize) ā€“ PythonNut

2 Answers

1
votes

I cannot reproduce your issue; maybe knowing your versions could help anyone to identify your issue. Can you reproduce your issue with "emacs -q" (plus adding evil to load-path)?

Here is an approach to identify the evil (traditional English meaning) piece of code, if any, that is calling to evil-normal-state:

(defadvice evil-normal-state (before debug-issue activate)
  (setq debug-on-error t)
  (inexisting-function-will-fail))

Eval this just after setting a buffer in the evil-state you want it to be, then go to to the minibuffer with M-x. Is there an stacktrace?

1
votes

You may reactivate evil-mode by adding whatever function you use to activate it to minibuffer-exit-hook.