Created
August 29, 2013 15:26
-
-
Save pkkm/6379532 to your computer and use it in GitHub Desktop.
Package init.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(package-initialize) ; Load package.el and all packages now. This normally happens after loading the init file. | |
(setq package-enable-at-startup nil) ; Don't load the packages the second time after the init file. | |
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") | |
("melpa" . "http://melpa.milkbox.net/packages/"))) | |
;; To update installed packages, use M-x package-list-packages RET U x. | |
;; Or delete the elpa/ directory and launch Emacs for it to be recreated. | |
(defun package-ensure-installed (package) | |
"Ensure the ELPA package PACKAGE is installed." | |
(unless (package-installed-p package) | |
(unless package-list-refreshed-p | |
(package-refresh-contents) | |
(setq package-list-refreshed-p t)) | |
(package-install package))) | |
(defvar package-list-refreshed-p nil | |
"Was the package list refreshed in this Emacs session?") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment