Subject: Re: bug#59358: 29.0.50; failing to load .eln for init file sets user-init-file to warnings.el

From: Andrea Corallo <[email-masked]>
Date: Mon, 28 Nov 2022 13:58:07 +0000

Eli Zaretskii <[email-masked]> writes:

>> From: Juanma Barranquero <[email-masked]>
>> Date: Sun, 27 Nov 2022 20:53:27 +0100
>> Cc: [email-masked], [email-masked]
>> 
>> This patch below is what I did, *just* to get comp not to complain about the "missing" .emacs.el.
>> 
>> Then something should be done to make it to compile .emacs, and I'm not sure where or how.
>
> So the problem is not to find the source of .emacs.elc, the problem is also
> to compile .emacs natively into .emacs.eln?  I though the problem was only
> the former.
>
>> I can't shake the feeling that I'm thrashing around and someone who knows the code could do it faster and
>> cleaner.
>
> I'm not sure a cleaner way exists, but I will let Andrea chime in.
>
> Note that there's also maybe_defer_native_compilation.

Hello all,

yes I think Juanma you should have a look into
'maybe_defer_native_compilation'.

This will be called when the first byte compiled function defined in
your .emacs (if any) is being loaded.  As you can see
'maybe_defer_native_compilation' tries to reconstruct the src filename,
so I guess this need some tweaking for this specific case.

Best Regards

  Andrea