Subject: Re: bug#47987: 28.0.50; [native-comp] Can't compile ELN if EL and ELC reside in different directories

From: Eli Zaretskii <[email-masked]>
Date: Tue, 27 Apr 2021 20:41:01 +0300

> Cc: [email-masked]
> Date: Tue, 27 Apr 2021 17:00:28 +0000
> From:  Andrea Corallo via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> The trouble is that given the bytecode being loaded Emacs needs to find
> the source file, both to native compile it (if necessary) both to hash
> it in order to the locate the correct .eln file to load.
> 
> Now given the .elc file removing the final 'c' was the simple algo
> applied for this scope :)  But is this is not sufficient we have to
> either provide a more sophisticate mechanism so that a package can
> register a new mapping or either disable eln load for some package.

We can either (a) look in all the directories in load-path, if the .el
file is not found in the same directory as the .elc; or (b) add a new
variable a-la load-path that is only searched if the current look up
fails.

I prefer the former, unless it has some downsides.