Skip to content

Instantly share code, notes, and snippets.

@binarin
Created February 7, 2014 08:38
Show Gist options
  • Save binarin/8859119 to your computer and use it in GitHub Desktop.
Save binarin/8859119 to your computer and use it in GitHub Desktop.
(require 'cl)
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(unless (package-installed-p 'dash)
(package-refresh-contents)
(package-install 'dash))
(require 'dash)
(defun ensure-packages (package-list)
(unless (-all? #'package-installed-p package-list)
;; check for new packages (package versions)
(message "%s" "Installing more packages...")
(package-refresh-contents)
(message "%s" " done.")
;; install the missing packages
(-each
(-reject #'package-installed-p package-list)
#'package-install)))
(ensure-packages '(project-explorer))
(require 'project-explorer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment