Skip to content

Commit

Permalink
borg-update-autoloads: Add to load-path again
Browse files Browse the repository at this point in the history
Autoload files are supposed to add the containing directory to the
`load-path'.  This was lost when `autoload' was deprecated in favor
of `loaddefs-gen'.  This is a known issue (see bug#63625).  Use the
same workaround as used by `package-generate-autoloads'.  Instead of
relying on `loaddefs-generate' to do it on its own, pass appropriate
EXTRA-DATA to it.

Closes #159.
  • Loading branch information
tarsius committed Feb 5, 2024
1 parent 4666dd7 commit 94b9be7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion borg.el
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,15 @@ and optional NATIVE are both non-nil, then also compile natively."
(lambda (string &optional _message type)
(with-no-warnings
(borg--byte-compile-info string nil type)))))
(loaddefs-generate path file excludes)))
(loaddefs-generate
path file excludes
;; Same kludge as used in `package-generate-autoloads'.
(prin1-to-string
'(add-to-list 'load-path
(or (and load-file-name
(directory-file-name
(file-name-directory load-file-name)))
(car load-path)))))))
((let (;; This defaults to `nil' on Emacs 26 through 28, there
;; is no need to double down on the default, and by not
;; doing that, we avoid a warning on Emacs 25.
Expand Down

0 comments on commit 94b9be7

Please sign in to comment.