]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix calling `package-reinstall' just after quick initialization.
authorMatt Armstrong <matt@rfc20.org>
Thu, 6 Oct 2022 12:08:20 +0000 (14:08 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 6 Oct 2022 12:08:20 +0000 (14:08 +0200)
* 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

index 4abee9d05383c72ef5dc2c1af7f71b3ad66fd220..812e1eb0ff73aed96d11ee676cc517ae7fa27198 100644 (file)
@@ -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)