pr fix autoload generation recursion error#953
Conversation
|
The hload-path autoload generation is from long ago as is that whole setup when Emacs could not find its own executable directory. Are you saying that the PR has all the defs needed to work if there are no autoloads? If so, we should be able to go with this.
|
Yes, I think that is the case. Our CI build targets does generate autoloads before byte compiling so the CI build is not a perfect confirmation of that. It is just an indirect one since the hload-path check for the autoloads requires an interactive Emacs. I have tested locally by running "make clean new-bin" which builds the elcs without building the autoloads. I have also tested to start en Emacs without the autoloads and then they are generated and loaded. The later I guess is what always happens when you run from source without using a package manager. |
rswgnu
left a comment
There was a problem hiding this comment.
Generally fine, fix 2 comments and then can approve.
|
The issue is if the call references any symbols defined in the file below it or loaded after the call is made. So you basically have to test all the run paths of any function calls you move.-- BobOn May 14, 2026, at 9:59 AM, Mats Lidell ***@***.***> wrote:
@matsl commented on this pull request.
In hycontrol.el:
@@ -91,7 +91,7 @@
;; perpendicular to that edge by 50% while keeping the original edge
OK. Lets fix that first then since the location of these definitions when placed down in the file caused many compile warnings because of access to these symbols from within the file. Those could be resolved by forward declarations in the top of the file but I find that to be a code smell if it can be resolved within a file by fixing the order.
Since these are autoloaded they did not case any errors when we load the autoloads before byte compiling.
So to resolve the warnings I moved the code block up to be before where they are referenced and did not think more about that. What issues can there be due to that rearrangement?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because your review was requested.Message ID: ***@***.***>
|
|
I moved out the hycontrol changes. So now we have these warnings that the change to hycontrol was fixing: |
|
See PT #954 for the hycontrol changes as requested in a separate PR. |
* hload-path.el: Only generate and load autoloads when interactive
Add declare-function and defvar declarations so each el-file can be byte compiled without requiring the autoloads to be loaded.
6ff57c1 to
5e1a2e4
Compare
What
Do not load and generate autoloads from hload-path while in batch
processing (such as byte compiling).
Why
When generating autoloads in Emacs 31 we get this error below. It does
not occur with older versions.
The recursive load seems to origin from hload-path.el having a call to
check if autoloads are generated and if not generate and load them.
This PR tries to solve this by limiting the generation and loading of
autoloads to an interactive Emacs.
Further, the byte compile errors that occurs due to not loading
autoloads are resolved by adding declare-function and defvar. Each
el-file is by that possible to compile without having to load the
autoloads.
Note
I though this was a good experiment for solving the loaddefs-gen issue
by decoupling byte compilation from autoloads generation.
It also brought my attention to that we generate autoloads from
hload-path which feels a bit odd. I mean for normal use the autoloads
are generated by the package manager or, when running from source, by our
make target. Anyway this PR does not change that. An interactive Emacs
behaves the same.