Skip to content

Instantly share code, notes, and snippets.

@dmb2
Created September 8, 2014 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmb2/c3173d0731f9cb0792f4 to your computer and use it in GitHub Desktop.
Save dmb2/c3173d0731f9cb0792f4 to your computer and use it in GitHub Desktop.
Automatically install packages needed by the rest of init.el on a fresh computer.
(defun install-required-packages (package-list)
(when (>= emacs-major-version 24)
(package-refresh-contents)
(mapc (lambda (package)
(unless (require 'package nil t)
(package-install 'package)))
package-list)))
(setq required-package-list '(bm icicles smex zenburn-theme))
(install-required-packages required-package-list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment