mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-05 12:37:33 -05:00
fix: nil load-file-name in package autoloads
Some packages do funky things in their autoloads, so care is needed to closely emulate an autoloading environment when loading them, however, in8cafbe4
, Doom wraps these autoloads in a function, thus ensuring they're executed without `load-file-name` or `load-in-progress` set, which some packages will expect these in their autoloads. This fixes the (wrong-type-argument stringp nil) error some folks see with certain packages doing said funky things in their autoloads (like realgun in the :tools debugger module). Fix: #8143 Amend:8cafbe4408
This commit is contained in:
@ -397,24 +397,26 @@ caches them in `doom--profiles'. If RELOAD? is non-nil, refresh the cache."
|
||||
|
||||
(defun doom-profile--generate-doom-autoloads ()
|
||||
`((defun doom--startup-module-autoloads ()
|
||||
,@(doom-autoloads--scan
|
||||
(append (doom-glob doom-core-dir "lib/*.el")
|
||||
(cl-loop for dir
|
||||
in (append (doom-module-load-path)
|
||||
(list doom-user-dir))
|
||||
if (doom-glob dir "autoload.el") collect (car it)
|
||||
if (doom-glob dir "autoload/*.el") append it)
|
||||
(mapcan #'doom-glob doom-autoloads-files))
|
||||
nil))))
|
||||
(let ((load-in-progress t))
|
||||
,@(doom-autoloads--scan
|
||||
(append (doom-glob doom-core-dir "lib/*.el")
|
||||
(cl-loop for dir
|
||||
in (append (doom-module-load-path)
|
||||
(list doom-user-dir))
|
||||
if (doom-glob dir "autoload.el") collect (car it)
|
||||
if (doom-glob dir "autoload/*.el") append it)
|
||||
(mapcan #'doom-glob doom-autoloads-files))
|
||||
nil)))))
|
||||
|
||||
(defun doom-profile--generate-package-autoloads ()
|
||||
`((defun doom--startup-package-autoloads ()
|
||||
,@(doom-autoloads--scan
|
||||
(mapcar #'straight--autoloads-file
|
||||
(nreverse (seq-difference (hash-table-keys straight--build-cache)
|
||||
doom-autoloads-excluded-packages)))
|
||||
doom-autoloads-excluded-files
|
||||
'literal))))
|
||||
(let ((load-in-progress t))
|
||||
,@(doom-autoloads--scan
|
||||
(mapcar #'straight--autoloads-file
|
||||
(nreverse (seq-difference (hash-table-keys straight--build-cache)
|
||||
doom-autoloads-excluded-packages)))
|
||||
doom-autoloads-excluded-files
|
||||
'literal)))))
|
||||
|
||||
(provide 'doom-lib '(profiles))
|
||||
;;; profiles.el ends here
|
||||
|
Reference in New Issue
Block a user