Skip to content

Commit

Permalink
Merge pull request #1151 from radian-software/rr-autoloads-fool
Browse files Browse the repository at this point in the history
[#1150] Fix load-history when eval autoloads
  • Loading branch information
raxod502 authored Jan 20, 2025
2 parents 6e20abf + 5afe576 commit ec4eb22
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions straight.el
Original file line number Diff line number Diff line change
Expand Up @@ -5503,11 +5503,22 @@ RECIPE is a straight.el-style plist."
straight--autoloads-cache)))
;; Some autoloads files expect to be loaded normally, rather
;; than read and evaluated separately. Fool them.
;;
;; We also need to abuse `current-load-list' so that
;; autoload entries go properly into the current entry,
;; since normally that is hardcoded to happen during `load'
;; which we are not using here.
;;
;; https://github.com/radian-software/straight.el/issues/1150
;; for information on that.
(let ((load-file-name (straight--autoloads-file package))
(load-in-progress t))
(load-in-progress t)
(current-load-list nil))
;; car is the feature list, cdr is the autoloads.
(dolist (form (cdr (gethash package straight--autoloads-cache)))
(eval form))))
(eval form))
(when current-load-list
(push (cons load-file-name current-load-list) load-history))))
(straight--load-package-autoloads package))))

;;;; Interactive helpers
Expand Down

0 comments on commit ec4eb22

Please sign in to comment.