The byte compiler does not evaluate top-level forms normally. require
is a special case, but the add-to-list
calls, which extend load-path
, are not visible to the byte compiler.
You need to wrap them in eval-and-compile
:
(eval-and-compile
(add-to-list 'load-path "~/.emacs.d/.")
(add-to-list 'load-path "~/.emacs.d/exec-path-from-shell"))
This forces the byte compiler to evaluate these calls, so the load-path
is properly extended at compile time.
Note that you should not add ~/.emacs.d
to load-path
, and the byte compiler will warn you if you do.
You should probably just use package.el to install packages. It'll handle all of this automatically.