technomancy / emacs-starter-kit

[ARCHIVED] this is ancient history
GNU General Public License v3.0
2.87k stars 887 forks source link

Suggestion: include package-refresh-contents for automated init.el example #168

Open xpe opened 9 years ago

xpe commented 9 years ago

I suggest expanding your writeup to include this right after package-initialize:

(unless package-archive-contents
  (package-refresh-contents))

Your write-up currently suggests this code:

(defvar my-packages '(better-defaults paredit idle-highlight-mode ido-ubiquitous
                                      find-file-in-project magit smex scpaste))
(package-initialize)
(dolist (p my-packages)
  (when (not (package-installed-p p))
    (package-install p)))

I found it to be incomplete; the package-refresh-contents is required for a brand-new installation, in my experience. I got the code from http://stackoverflow.com/a/10093312/109618