aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/package.el26
1 files changed, 15 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index b65e45b1bf6..29de2c9b07f 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2023,17 +2023,21 @@ If some packages are not installed propose to install them."
2023 ;; gets installed). 2023 ;; gets installed).
2024 (if (not package-selected-packages) 2024 (if (not package-selected-packages)
2025 (message "`package-selected-packages' is empty, nothing to install") 2025 (message "`package-selected-packages' is empty, nothing to install")
2026 (cl-loop for p in package-selected-packages 2026 (let* ((not-installed (seq-remove #'package-installed-p package-selected-packages))
2027 unless (package-installed-p p) 2027 (available (seq-filter (lambda (p) (assq p package-archive-contents)) not-installed))
2028 collect p into lst 2028 (difference (- (length not-installed) (length available))))
2029 finally 2029 (cond
2030 (if lst 2030 (available
2031 (when (y-or-n-p 2031 (when (y-or-n-p
2032 (format "%s packages will be installed:\n%s, proceed?" 2032 (format "%s packages will be installed:\n%s, proceed?"
2033 (length lst) 2033 (length available)
2034 (mapconcat #'symbol-name lst ", "))) 2034 (mapconcat #'symbol-name available ", ")))
2035 (mapc #'package-install lst)) 2035 (mapc (lambda (p) (package-install p 'dont-select)) available)))
2036 (message "All your packages are already installed"))))) 2036 ((> difference 0)
2037 (message "%s packages are not available (the rest already installed), maybe you need to `M-x package-refresh-contents'"
2038 difference))
2039 (t
2040 (message "All your packages are already installed"))))))
2037 2041
2038 2042
2039;;; Package Deletion 2043;;; Package Deletion