From c2296b34faba4d5f811ac2d995152f0e99a888b4 Mon Sep 17 00:00:00 2001 From: Sean Devlin Date: Mon, 28 Oct 2024 10:34:48 -0400 Subject: [PATCH] Use prefix argument in 'package-install-selected-packages' * 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 | 5 +++++ lisp/emacs-lisp/package.el | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index dc88b5f8617..e89133fec03 100644 --- 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. + * New Modes and Packages in Emacs 31.1 diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 95db55bb9f7..7a8e5a685d9 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -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 -- 2.39.5