0

I have the following:

(use-package evil
  :hook
  (after-init . evil-mode)
  (evil-normal-state-entry . hydra-evil/body))

When leaving the emacs state (with C-z) and entering normal state, all my buffers are killed and the *Messages* buffer reads:

walk-window-tree-1: Lisp nesting exceeds ‘max-lisp-eval-depth’

Here is the backtrace if relevant: http://ix.io/2sI9

  • It would help if you'd state why your use-package code doesn't solve the problem. I've tried writing the equivalent without use-package and ran into bizarre errors. Knowing that much helps tremendously to figure out how to answer this question. – wasamasa Jul 30 at 16:19
  • @wasamasa Looks like the end of my post didn't get through, added the error encountered. – Mathieu Marques Jul 30 at 16:36
  • Both the error message and the backtrace indicate an "infinite" recursion. Beyond that, you got to debug :-) – NickD Jul 30 at 18:59
  • @NickD But why would the hook run more than once? – Mathieu Marques Jul 30 at 21:07
  • There is some unexpected interaction: evil-initialize runs tte evil-normal-state-hook which calls into hydra, which tries to leave a hint in the lv window. That somehow invokes fundamental-mode which runs the after-change-major-mode-hook which calls evil-mode-enable-in-buffers which calls evil-initialize and the whole thing repeats. You've got to break the cycle somewhere, but I know nothing about evil and almost nothing about hydra, so I won't be able to help. – NickD Jul 30 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.