From ad85bd3d5dd0dda1fcce00b3ad25b36ec8efdda4 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Fri, 18 Jan 2013 10:44:17 +0000 Subject: [PATCH] Support packages where autoload and elpa name are different. 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). --- use-package.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/use-package.el b/use-package.el index 63223a3a..3b517470 100644 --- a/use-package.el +++ b/use-package.el @@ -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