Each time I install a package from the Package Menu, if I havetry to require
it in my init file I get an error unless I manually add it to the load-path and explicitly require the functions:
(add-to-list 'load-path "/home/nick/.emacs.d/elpa/use-package-20141220.1645")
(require 'use-package-autoloads)
(require 'use-package)
That's tedious. And usually the package path contains version-numbers. If a package was updated, I have to manually edit the load-path.
Is there any way to automatic these steps?
Update
I use ~/.emacs.d/init.el
as the configuration file and there's no ~/.emacs
. I guess this might be the problem so I added (load "~/.emacs.d/init.el")
to ~/.emacs
, andautomate this time, I don't need to add those load-path
.
According to the Emacs documentation:
49.4 The Emacs Initialization File
When Emacs is started, it normally tries to load a Lisp program from an "initialization file", or "init file" for short. This file, if it exists, specifies how to initialize Emacs for you. Emacs looks for your init file using the filenames
~/.emacs
,~/.emacs.el
, or~/.emacs.d/init.el
; you can choose to use any one of these three names (*note Find Init::
). Here,~/
stands for your home directory.
I don't see any difference between .emacs
and init.el
. Can anyone explain?