]> git.eshelyaron.com Git - emacs.git/commitdiff
Support packages where autoload and elpa name are different
authorPhillip Lord <phillip.lord@russet.org.uk>
Fri, 18 Jan 2013 10:44:17 +0000 (10:44 +0000)
committerPhillip Lord <phillip.lord@russet.org.uk>
Fri, 18 Jan 2013 10:44:17 +0000 (10:44 +0000)
Some packages such as ECB already provide an autoload file,
so it is this that use-package needs to require. However,
the ELPA name is ecb. This commit allows ensure to take an
argument (other than t).

lisp/use-package/use-package.el

index 63223a3a26ab4a67f0757bc036345681c1f82b06..3b5174700d5b228601d2acb2bff368abfeb7a15d 100644 (file)
@@ -369,12 +369,17 @@ For full documentation. please see commentary.
          (name-string (if (stringp name) name (symbol-name name)))
          (name-symbol (if (stringp name) (intern name) name)))
 
+    ;; force this immediately -- one off cost
     (unless (plist-get args :disabled)
-      
-      ;; force this immediately -- one off cost!
-      (if (plist-get args :ensure)
-          (use-package-ensure-elpa name))
-      
+      (let* ((ensure (plist-get args :ensure))
+             (package-name 
+              (or (and (eq ensure t)
+                       name)
+                  ensure)))
+      (when package-name 
+        (use-package-ensure-elpa package-name)))
+               
+
       (if diminish-var
           (setq config-body
                 `(progn