package.el: Fix bug#80172

* lisp/emacs-lisp/package-activate.el: Move defvar of
`Info-directory-list` to when we know it should exist.

* lisp/emacs-lisp/package.el (Info-directory-list): Defvar before we
`let-bind it.
This commit is contained in:
Stefan Monnier 2026-01-13 15:23:19 -05:00
parent 66ff6064f5
commit a9bf57155b
2 changed files with 3 additions and 1 deletions

View file

@ -329,7 +329,6 @@ PKG-DESC is a `package-desc' object."
(format "%s-autoloads" (package-desc-name pkg-desc))
(package-desc-dir pkg-desc)))
(defvar Info-directory-list)
(declare-function info-initialize "info" ())
(defvar package--quickstart-pkgs t
@ -340,6 +339,7 @@ PKG-DESC is a `package-desc' object."
(when (file-exists-p (expand-file-name "dir" pkg-dir))
;; FIXME: not the friendliest, but simple.
(require 'info)
(defvar Info-directory-list)
(info-initialize)
(add-to-list 'Info-directory-list pkg-dir)))

View file

@ -4524,6 +4524,8 @@ The list is displayed in a buffer named `*Packages*'."
;;;; Quickstart: precompute activation actions for faster start up.
(defvar Info-directory-list)
;; Activating packages via `package-initialize' is costly: for N installed
;; packages, it needs to read all N <pkg>-pkg.el files first to decide
;; which packages to activate, and then again N <pkg>-autoloads.el files.