From c28874e95644085e3ee33f528ea6cc7b72f8f330 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Mon, 31 Dec 2012 17:58:45 +0100 Subject: [PATCH] ELPA package support --- lisp/use-package/use-package.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index f9bc5c2b32e..3dce341e9da 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -314,6 +314,12 @@ :url (match-string 1)))))))) args)) + +(defun use-package-ensure-elpa (package) + (when (not (package-installed-p package)) + (package-install package))) + + (defmacro use-package (name &rest args) (let* ((commands (plist-get args :commands)) (pre-init-body (plist-get args :pre-init)) @@ -342,6 +348,11 @@ (name-symbol (if (stringp name) (intern name) name))) (unless (plist-get args :disabled) + + ;; force this immediately -- one off cost! + (if (plist-get args :ensure) + (use-package-ensure-elpa name)) + (if diminish-var (setq config-body `(progn -- 2.39.2