From: Matthew Feinberg Date: Thu, 21 Jul 2016 12:38:30 +0000 (-0400) Subject: Make pin and ensure compatible X-Git-Tag: emacs-29.0.90~1306^2~15^2~291^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5053f75e0080b1e56d2e8a913f1621e48d684a0d;p=emacs.git Make pin and ensure compatible `:pin` does not work with `:ensure`, because it doesn't add the package to package-pinned-packages until after reading the package archive contents. This change causes the package archive contents to be reread if the package is pinned and `:ensure` is being used. Copyright-paperwork-exempt: yes --- diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index f81b64a02c7..92c35a42950 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -500,6 +500,8 @@ manually updated package." (defun use-package-ensure-elpa (package &optional no-refresh) (if (package-installed-p package) t + (if (and (not no-refresh) (assoc package package-pinned-packages)) + (package-read-all-archive-contents)) (if (or (assoc package package-archive-contents) no-refresh) (package-install package) (progn