1

I need some help understanding Emacs initialization and load-path variable construction. So, there is the init file .emacs (or .emacs.d/init.el) file in $HOME, that is loaded first, and at the point this file is about to be read, load-path already contains directories from /etc, /usr/*, e.g. directories from the Emacs distribution itself.

After loading the init file is there any standard Emacs initialization files, that scan through .emacs.d and adds subdirectories it finds there?

The Emacs manual says something about subdirs.el in the first Emacs initialization step (https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html#Startup-Summary), but it happens before loading the init file and I do not understand the language used:

  1. It adds subdirectories to load-path, by running the file named subdirs.el in each directory in the list.

In which "the list"?

asked Mar 2, 2016 at 20:36

2 Answers 2

2

In this step "the list" is actually the preloaded installation values in load-path. The rest of the points are clear in the steps performed. For instance, some Debian/Ubuntu distributions add some system-wide configuration files in /etc/emacsXX, and this is hard coded in the source code when he package is compiled as some of the initial paths in load-path.

answered Mar 2, 2016 at 20:46
Sign up to request clarification or add additional context in comments.

Comments

1

After loading the init file is there any standard Emacs initialization files, that scan through .emacs.d and adds subdirectories it finds there?

In general, no -- Emacs will not automatically add arbitrary subdirectories to your load-path (and nor would you want it to).

This does happen for some particular subdirectories, however.

As of Emacs 24 the in-built package manager will automatically add your installed ELPA package directories to the load-path after your init file has been evaluated.

(And/or when package-initialize is called explicitly, if you do that.)

By default your ELPA packages live under ~/.emacs.d/elpa/

answered Mar 3, 2016 at 1:32

1 Comment

OK, I see. package-initialize is actually mentioned in the summary of "starting up" in the reference manual.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.