From e24f276f8a639faeaec516e758996354dd49a5b7 Mon Sep 17 00:00:00 2001 From: Matt Armstrong Date: Thu, 6 Oct 2022 14:08:20 +0200 Subject: [PATCH] Fix calling `package-reinstall' just after quick initialization. * lisp/emacs-lisp/package.el (package-reinstall): call `package--archives-initialize', just like `package-install' does. This populates `package-alist', and so fixes calling `package-reinstall' as the first thing done after package "quick init" (Bug#53527). --- lisp/emacs-lisp/package.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 4abee9d0538..812e1eb0ff7 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2436,10 +2436,14 @@ If NOSAVE is non-nil, the package is not removed from "Reinstall package PKG. PKG should be either a symbol, the package name, or a `package-desc' object." - (interactive (list (intern (completing-read - "Reinstall package: " - (mapcar #'symbol-name - (mapcar #'car package-alist)))))) + (interactive + (progn + (package--archives-initialize) + (list (intern (completing-read + "Reinstall package: " + (mapcar #'symbol-name + (mapcar #'car package-alist))))))) + (package--archives-initialize) (package-delete (if (package-desc-p pkg) pkg (cadr (assq pkg package-alist))) 'force 'nosave)