fix: indexing packages' Info documents (part 2)

The issue required a more systemic fix, because the former (before
9e6c46a even) only recorded `Info-directory-list` for the packages that
were installed/updated in that `doom sync` session, forgetting all
packages installed in the past.

Fix: #8143
Amend: 9e6c46a332
This commit is contained in:
Henrik Lissner
2024-11-03 22:15:02 -05:00
parent b26980a4a4
commit 7531c4298e
2 changed files with 22 additions and 18 deletions

View File

@ -16,7 +16,8 @@ hoist buggy forms into autoloads.")
auto-mode-alist auto-mode-alist
interpreter-mode-alist interpreter-mode-alist
magic-mode-alist magic-mode-alist
magic-fallback-mode-alist) magic-fallback-mode-alist
Info-directory-list)
"A list of variables to be cached in `doom-autoloads-file'.") "A list of variables to be cached in `doom-autoloads-file'.")
(defvar doom-autoloads-files () (defvar doom-autoloads-files ()

View File

@ -291,22 +291,15 @@ caches them in `doom--profiles'. If RELOAD? is non-nil, refresh the cache."
(print! (start "Reading %s...") file)) (print! (start "Reading %s...") file))
(doom-file-read file :by 'insert)) (doom-file-read file :by 'insert))
(prin1 `(defun doom-startup () (prin1 `(defun doom-startup ()
(let ((startup-or-reload? ;; Make sure this only runs at startup to protect us
;; Make sure this only runs at startup to protect ;; Emacs' interpreter re-evaluating this file when
;; us Emacs' interpreter re-evaluating this file ;; lazy-loading dynamic docstrings from the byte-compiled
;; when lazy-loading dynamic docstrings from the ;; init file.
;; byte-compiled init file. (when (or (doom-context-p 'startup)
(or (doom-context-p 'startup) (doom-context-p 'reload))
(doom-context-p 'reload)))) ,@(cl-loop for (_ genfn initfn) in doom-profile-generators
(when startup-or-reload? if (fboundp genfn)
,@(cl-loop for (_ genfn initfn) in doom-profile-generators collect (list initfn))))
if (fboundp genfn)
collect (list initfn))
,@(when-let* ((info-dirs (butlast Info-directory-list)))
`((require 'info)
(info-initialize)
(setq Info-directory-list
(append ',info-dirs Info-directory-list)))))))
(current-buffer))) (current-buffer)))
(print! (start "Byte-compiling %s...") (relpath init-file)) (print! (start "Byte-compiling %s...") (relpath init-file))
(print-group! (print-group!
@ -421,7 +414,17 @@ caches them in `doom--profiles'. If RELOAD? is non-nil, refresh the cache."
(nreverse (seq-difference (hash-table-keys straight--build-cache) (nreverse (seq-difference (hash-table-keys straight--build-cache)
doom-autoloads-excluded-packages))) doom-autoloads-excluded-packages)))
doom-autoloads-excluded-files doom-autoloads-excluded-files
'literal))))) 'literal))
,@(when-let* ((info-dirs
(cl-loop for key in (hash-table-keys straight--build-cache)
for dir = (straight--build-dir key)
for file = (straight--build-file dir "dir")
if (file-exists-p file)
collect dir)))
`((require 'info)
(info-initialize)
(setq Info-directory-list
(append ',info-dirs Info-directory-list)))))))
(provide 'doom-lib '(profiles)) (provide 'doom-lib '(profiles))
;;; profiles.el ends here ;;; profiles.el ends here