diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-04-11 09:07:15 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-04-11 09:07:15 -0700 |
commit | ff2c76476479c43607825df01c78d8f239caefb5 (patch) | |
tree | 9eb72adddeab4fb7b0cebf49df81ab31f3bf8a13 /lisp/emacs-lisp/package.el | |
parent | d6ea6453f3d1696b9e6cd0a0222fc77dc646365c (diff) | |
parent | 80128a784912096c6b0ee46b76b068e019cff057 (diff) | |
download | emacs-ff2c76476479c43607825df01c78d8f239caefb5.tar.gz emacs-ff2c76476479c43607825df01c78d8f239caefb5.tar.bz2 emacs-ff2c76476479c43607825df01c78d8f239caefb5.zip |
Merge from origin/emacs-25
80128a7 Fix stability confusion in sort-tests
1e4aa42 Avoid describe-key error with lambdas
a05fb21 * lisp/emacs-lisp/package.el (package-install-selected-packag...
f501116 Sync with gnulib
c4963f9 Fix doc for Universal Time
Diffstat (limited to 'lisp/emacs-lisp/package.el')
-rw-r--r-- | lisp/emacs-lisp/package.el | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 869c1549658..4da66d2fabf 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2027,17 +2027,21 @@ If some packages are not installed propose to install them." ;; gets installed). (if (not package-selected-packages) (message "`package-selected-packages' is empty, nothing to install") - (cl-loop for p in package-selected-packages - unless (package-installed-p p) - collect p into lst - finally - (if lst - (when (y-or-n-p - (format "%s packages will be installed:\n%s, proceed?" - (length lst) - (mapconcat #'symbol-name lst ", "))) - (mapc #'package-install lst)) - (message "All your packages are already installed"))))) + (let* ((not-installed (seq-remove #'package-installed-p package-selected-packages)) + (available (seq-filter (lambda (p) (assq p package-archive-contents)) not-installed)) + (difference (- (length not-installed) (length available)))) + (cond + (available + (when (y-or-n-p + (format "%s packages will be installed:\n%s, proceed?" + (length available) + (mapconcat #'symbol-name available ", "))) + (mapc (lambda (p) (package-install p 'dont-select)) available))) + ((> difference 0) + (message "%s packages are not available (the rest already installed), maybe you need to `M-x package-refresh-contents'" + difference)) + (t + (message "All your packages are already installed")))))) ;;; Package Deletion |