Subject: bug#58509: 29.0.50; Synchronous nativecomp

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 14 Oct 2022 15:15:31 +0200

Eli Zaretskii <[email-masked]> writes:

>> That doesn't sound like a good interface, and fortunately that's not
>> how Emacs works interactively.
>
> Interactively, async compilation is triggered by actually _loading_
> stuff.  You cannot have Emacs load everything that is need for some
> function call, unless you let the code of that function actually run,
> because only running it will reveal all that's needed to be loaded.
> Think about autoloads, eval-after-load, etc.  How can Emacs know what
> files to compile ahead of running the code you are asking it to run?
> Or what am I missing?

It really sounds like you're not familiar with how the nativecomp
machinery works?

When Emacs is asked to load a file, no matter how it is asked to do so,
it (eventually) looks at the .elc file (if any).  This makes the
native-comp machinery kick in, and at present (like I said in the
original description here) it adds the .el file to a list of files that
will be native-compiled in the background, and then loads the .eln file
later.

And like I said, at that point, we could instead just go ahead and
native-compile the .el file, and then load the .eln file instead of
loading the .elc file, synchronously.

Nothing needs to be known in advance, because the nativecomp machinery
already has all this under control.

And, yes, this thread has been really annoying, because I explained all
this in the first message already.