Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have several config files in ~.emacs.d/elisp/. I want to load them on emacs startup. I'm using this line:

(add-to-list 'load-path "~/.emacs.d/elisp/")

I assume that adds the contents of the directory to the files loaded at startup. But the files are not loaded. Why?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

emacs doesn't load automatically. you should explicitly ask emacs to load a file.

eg: to load a feature.el in ~/.emacs.d/elisp directory
you can say..

(add-to-list 'load-path "~/.emacs.d/elisp/")
(require 'feature)
share|improve this answer
2  
And if it is just a config file (not an emacs extension/package providing a feature), you may need (load-file "~/.emacs.d/elisp/mysettings"). require will work anyway (see the doc for require), but just as a fallback mechanism. –  Juancho Jul 30 '11 at 19:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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