]> git.eshelyaron.com Git - emacs.git/commitdiff
ELPA package support
authorPhillip Lord <phillip.lord@russet.org.uk>
Mon, 31 Dec 2012 16:58:45 +0000 (17:58 +0100)
committerPhillip Lord <phillip.lord@russet.org.uk>
Mon, 31 Dec 2012 16:58:45 +0000 (17:58 +0100)
lisp/use-package/use-package.el

index f9bc5c2b32ecf2938bf4743571ab55d7838b50f3..3dce341e9da490c1670754f9318b3f15c70b3a5c 100644 (file)
                                     :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))
          (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