summaryrefslogtreecommitdiff
path: root/lisp/use-package
diff options
context:
space:
mode:
authorMatthew Feinberg <ketbra@users.noreply.github.com>2016-07-21 08:38:30 -0400
committerMatthew Feinberg <ketbra@users.noreply.github.com>2016-07-21 08:38:30 -0400
commit5053f75e0080b1e56d2e8a913f1621e48d684a0d (patch)
tree5820f7e1f320d0c343db53ccdb0de65b1267a0b4 /lisp/use-package
parent811c99da52654d0605242814f812e44ef51835ad (diff)
downloademacs-5053f75e0080b1e56d2e8a913f1621e48d684a0d.tar.gz
emacs-5053f75e0080b1e56d2e8a913f1621e48d684a0d.tar.bz2
emacs-5053f75e0080b1e56d2e8a913f1621e48d684a0d.zip
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
Diffstat (limited to 'lisp/use-package')
-rw-r--r--lisp/use-package/use-package.el2
1 files changed, 2 insertions, 0 deletions
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