From cb62fa80d1a000cd61cae769be47fb607556be61 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 31 Jan 2025 08:55:02 +0100 Subject: [PATCH] Refresh package list without blocking * lisp/emacs-lisp/package.el (package-refresh-contents): Run asynchronously when invoked interactively. * etc/NEWS: Mention the change. (cherry picked from commit 4cc8709ac2ceb0888ed1868292400049b98fe642) --- lisp/emacs-lisp/package.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index f9cce4f1149..7981e328e2e 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1858,8 +1858,11 @@ For each archive configured in the variable `package-archives', inform Emacs about the latest versions of all packages it offers, and make them available for download. Optional argument ASYNC specifies whether to perform the -downloads in the background." - (interactive) +downloads in the background. This is always the case when the command +is invoked interactively." + (interactive (list t)) + (when async + (message "Refreshing package contents...")) (unless (file-exists-p package-user-dir) (make-directory package-user-dir t)) (let ((default-keyring (expand-file-name "package-keyring.gpg" -- 2.39.5