bug#81105: 32.0.50; installed ELPA package info missing on some distros after commit 7c22a7d
Philip Kaludercic <[email protected]> Fri, 31 Jul 2026 19:18:19 +0000
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
Lin Jian <[email protected]> writes: > Philip Kaludercic <[email protected]> writes: > >> (Note that you shouldn't directly CC other people when reporting a bug, >> but add them to the X-Debuggs-CC pseudo-header. That way when I >> respond, I don't accidentally respond to [email protected], thus >> creating a new bug report.) > > Thanks for the info. > >> Can you verify if calling `info-initialize' in early-init.el changes anything? > > (info) can find installed package info after doing so. Thanks for confirming this, then we can be sure that this is not an Nix-related issue. Vonfry <[email protected]> writes: > I'd like to add additional contexts on this issue: > > After commit 7c22a7d312c7a3f3b6b511df5e6334ad8b2795b1 for Bug#80495, > the package-activate, usually called from package-initialize, adds > pkg-dir into `Info-default-directory-list' without a preloaded info.el. > IMO, info.el is loaded after package initialized, in most cases. > When users set INFOPATH, `info-initialize' will override > `Info-directory-list' by INFOPATH instead of using > `Info-default-directry-list'. > > According to doc on `Info-directory-list', we can add an end `:' > (`path-separator') to INFOPATH, in which case > `Info-default-directory-list' will be added into `Info-directory-list'. > > But this processing flow isn't good for users that they have to set a > such end `:' manually to register packages info dir. I wouldn't say that would be the worst idea. The main issue is that by doing this, we don't just include the directories listed in `Info-default-directory-list', but everything included in (Info-default-dirs), which might not be what the user intended. We could imagine populating `Info-additional-directory-list', but that has the same issue as `Info-directory-list' that it is not loaded by default and declaring it to be nil if unbound could create issues again, though less likely since the variable is less well known. I've CC'ed Eli since he is the maintainer of info.el for comments on how to progress. To summarize: In `package--add-info-node' we want to avoid loading info just to add a directory to `Info-directory-list', so we use `Info-default-directory-list' instead. The issue here is that the INFOPATH environmental variable is set _without_ a trailing ":", then `Info-default-directory-list' is ignored and we don't get any manuals for packages in the Info listing. The main question is if this is something that we should fix by just adjusting something in package.el (in the worse case we can revert our change on emacs-31 and go on loading info) or is there a proper way to use info.el here?
(unnamed)
(text/x-patch, 852 B)
diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el
index 5e2623c57f1..9cf00ca51c1 100644
--- a/lisp/emacs-lisp/package-activate.el
+++ b/lisp/emacs-lisp/package-activate.el
@@ -340,7 +340,13 @@ package--add-info-node
(if (boundp 'Info-directory-list)
'Info-directory-list
'Info-default-directory-list)
- pkg-dir)))
+ pkg-dir)
+ ;; Ensure that Info will respect `Info-default-directory-list' (see
+ ;; docstring) even if the INFOPATH environmental variable is set.
+ ;; (bug#81105)
+ (when-let* ((info-path (getenv "INFOPATH"))
+ (_ (not (string-suffix-p path-separator` info-path))))
+ (setenv "INFOPATH" (concat info-path ":")))))
(defun package-activate-1 (pkg-desc &optional reload deps)
"Activate package given by PKG-DESC, even if it was already active.