]> git.eshelyaron.com Git - emacs.git/commitdiff
Use prefix argument in 'package-install-selected-packages'
authorSean Devlin <spd@toadstyle.org>
Mon, 28 Oct 2024 14:34:48 +0000 (10:34 -0400)
committerEshel Yaron <me@eshelyaron.com>
Wed, 27 Nov 2024 19:50:50 +0000 (20:50 +0100)
* lisp/emacs-lisp/package.el (package-install-selected-packages):
When invoked with a prefix argument, skip user confirmation when
installing packages.
* etc/NEWS: Announce the prefix argument usage.  (Bug#73932)

(cherry picked from commit c66c0942ea9ac10e6d6324e472150de403a03b69)

etc/NEWS
lisp/emacs-lisp/package.el

index dc88b5f86174026e0143bb41129b4241ec85e81b..e89133fec03c51f42936a733633d99b0be6bae8b 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -644,6 +644,11 @@ If it is non-nil, or when invoked with a prefix argument,
 'package-autoremove' will not prompt the user for confirmation before
 removing packages.
 
+---
+*** New prefix argument for 'package-install-selected-packages'.
+When invoked with a prefix argument, 'package-install-selected-packages'
+will not prompt the user for confirmation before installing packages.
+
 \f
 * New Modes and Packages in Emacs 31.1
 
index 95db55bb9f758c17d7506d16102c97ed6b44d87d..7a8e5a685d9b0593f951c9b4fcf9373a071d198b 100644 (file)
@@ -2438,9 +2438,10 @@ directory."
 (defun package-install-selected-packages (&optional noconfirm)
   "Ensure packages in `package-selected-packages' are installed.
 If some packages are not installed, propose to install them.
-If optional argument NOCONFIRM is non-nil, don't ask for
-confirmation to install packages."
-  (interactive)
+
+If optional argument NOCONFIRM is non-nil, or when invoked with a prefix
+argument, don't ask for confirmation to install packages."
+  (interactive "P")
   (package--archives-initialize)
   ;; We don't need to populate `package-selected-packages' before
   ;; using here, because the outcome is the same either way (nothing