I'm trying multiple methods to load an emacs .el file on startup.

('load-file "~/.emacs.d/extra/outline-presentation-mode.el")


('load "~/.emacs.d/extra/outline-presentation-mode.el")


(mapc 'load (file-expand-wildcards "~/.emacs.d/extra/*.el"))

I've also tried adding the extra folder to my path and loading it without the file directory.

If I open emacs and then run:

M-x load-file RET ~/.emacs.d/extra/outline-presentation-mode.el

It works perfectly.

Why isn't it working when I try the same thing from my init.el file? I know the init.el file is running because I set my default bindings with evil-mode using it.

Also tried:

(load "~/.emacs.d/extra/outline-presentation-mode.el")

File I'm loading: https://web.archive.org/web/20160810000826/http://clandest.in/emacs.d/plain/outline-presentation.el

  • 3
    don't quote your function names : (load "~/path/to/file"), no apostrophe – Tyler Dec 4 '19 at 21:15
  • @Tyler thanks but still doesn't seem to work (load "~/.emacs.d/extra/outline-presentation-mode.el") – Philip Kirkbride Dec 4 '19 at 21:42
  • 1
    how does it "not work"? Is there an error message? – Tyler Dec 4 '19 at 21:45
  • 1
    I would use (load-file "~/.emacs.d/extra/outline-presentation-mode.el") and suggest you try an init file with only that, to eliminate other conflicts (e.g. perhaps Emacs isn't reaching that part of your init file due to other earlier errors). load-file will call expand-file-name for you, and tell load not to try other suffixes for the file. – phils Dec 4 '19 at 22:12
  • 2
    See C-h i g (emacs)Find Init. Emacs loads only the first init file that it finds. So you can use ~/.emacs.d/init.el, but not if you also have a ~/.emacs – phils Dec 4 '19 at 22:58

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.