I'm trying to have all of my dependencies install automatically for a new Emacs install. When I put the snippet below in my .emacs I keep getting: Package `smex-' is unavailable.
I was wondering if this is expected functionality? The Emacs starter-kit did something similar which I remember working before. Using Emacs 24.3.
(when (not package-archive-contents)
(package-refresh-contents))
(defvar my-packages
'(smex))
(dolist (p my-packages)
(let ((s (symbol-name p)))
(when (not (package-installed-p s))
(package-install s))))
EDIT
Apparently this was caused by a bug or something. I was able to get it to work now in latest Emacs 24.3.1. Apparently they've also changed it so that package names should be symbols.
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
(defvar my-packages
'(list of packages))
(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))
I encountered this issue when I was using
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/"))
after calling (package-initialize)
. If I execute
(setq package-archives '(("melpa" . "http://melpa.milkbox.net/packages/")
("gnu" . "http://elpa.gnu.org/packages/")))
before (package-initialize)
, then the automated installation logic is able to install missing packages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With