From 5cbfd926c5e4035fc46c17d4188015cb54204225 Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Thu, 4 Feb 2016 10:20:55 +0100 Subject: [PATCH 1/2] When :ensure is used install package as a selected package Also shutup bytecompiler about package-archive-contents. * use-package.el (use-package-ensure-elpa): Add package to selected package by using second arg of package install. --- lisp/use-package/use-package.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index dcc8842b6e9..05dbf651498 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -446,7 +446,7 @@ manually updated package." ;; ;; :ensure ;; - +(defvar package-archive-contents) (defun use-package-normalize/:ensure (name keyword args) (if (null args) t @@ -462,7 +462,7 @@ manually updated package." (if (package-installed-p package) t (if (or (assoc package package-archive-contents) no-refresh) - (package-install package) + (package-install package t) (progn (package-refresh-contents) (use-package-ensure-elpa package t))))) From c5e98d87dae831d3ed8527bd806f6c4814db8f9b Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Thu, 4 Feb 2016 11:19:23 +0100 Subject: [PATCH 2/2] Ensure package-install support a second argument * use-package.el (use-package-ensure-elpa): Do it. --- lisp/use-package/use-package.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 05dbf651498..98bbc417e65 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -462,7 +462,9 @@ manually updated package." (if (package-installed-p package) t (if (or (assoc package package-archive-contents) no-refresh) - (package-install package t) + (if (boundp 'package-selected-packages) + (package-install package t) + (package-install package)) (progn (package-refresh-contents) (use-package-ensure-elpa package t)))))