From time to time my Emacs doesn't load my init
file at startup and gives me the following error message:
File error: Cannot open load file, no such file or directory, session
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the `--debug-init' option to view a complete error backtrace.
File error: Cannot open load file, no such file or directory, session
The Problem turns out to be this code in my customization file:
(custom-set-variables
....
'(session-use-package t nil (session))
It is a variable from the session
package which saves my history in Emacs.
I have to delete this line and everything works again. Why is this added to my customization file and how can I avoid this annoying error? How could I investigate myself which event triggers this setting in my customization file?
Edit:
The part of my init
which loads the package looks like this:
(use-package session
:ensure t
:init
(add-hook 'after-init-hook 'session-initialize))