0

I have been working with org mode for some time, and recently installed evil mode and evil org mode via the melpa package tool.

For some reason though I cannot run M-x evil-mode (nor does it come up as an autocomplete suggestion), until I have first run M-x org-evil-mode. This is even the case if I am in fundamental mode, which seems very strange.

I have the following lines in my ~/.emacs which may have something to do with it, though as I said I have the same problem even if I manually switch to fundamental mode.

;;;;org-mode as default
;; Enable org-mode
(require 'org)
;; Make org-mode work with file ending in .txt
(add-to-list 'auto-mode-alist '("\\.txt$" . org-mode))

I am using GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-15, modified by Debian.

  • have you tried (require 'evil)? The reason it comes up with evil-org mode is that it requires it itself because evil is a dependency of org-evil. If you want to invoke evil-mode yourself you need to require evil. – Aquaactress Mar 19 '18 at 11:51
  • Thanks for the tip, I tried it, but (require 'evil) throws an error: no such file or directory. I presume you meant add this as a line to my ~/.emacs? I also tried (require 'evil-mode) and (require evil-org-mode), same problem. – harlandski Mar 20 '18 at 6:24
  • If you've installed evil as an ELPA package, then M-x evil-mode should work, as package initialization would process evil's autoloads, unless something in your config is preventing that from happening. Make sure that there aren't any errors when your init file is being processed. – phils Mar 20 '18 at 8:34
  • Strangely this didn't happen. As I've answered below, I've fixed it now. It's probably high time I overhauled my config though so thanks for the reminder – harlandski Mar 20 '18 at 10:30
0

It seems the problem was that I needed to properly initialize evil-mode from my ~/.emacs, as per this answer on Stack Overflow.

(package-initialize)
(evil-mode 1)

Now M-x evil-mode works without first having to run M-x evil-org-mode.

  • If this resolves the problem, please accept your own answer so we can mark the question as done. – Dan Oct 16 '18 at 16:27
  • OK, I've done that now. – harlandski Oct 19 '18 at 8:15
  • As nobody upvoted it, and it was clearly just my lack of knowledge that caused the problem, I also don't mind deleting the question if that would help. – harlandski Oct 19 '18 at 8:31

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.