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?

link|improve this question

feedback

1 Answer

up vote 3 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)
link|improve this answer
1  
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
feedback

Your Answer

 
or
required, but never shown

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