Subject: Re: bug#57627: 29.0.50; [native-compilation] cl-loaddefs.el recompiled on startup

From: Andrea Corallo <[email-masked]>
Date: Tue, 15 Oct 2024 15:20:08 -0400

Phil Sainty <[email-masked]> writes:

> On 2024-10-14 11:12, Andrea Corallo wrote:
>> +  (let ((file (save-match-data
>> +                (if (string-match (rx (group-n 1 (one-or-more nonl)
>> ".el") ".gz" eol)
>> +                                  file)
>> +                    (match-string 1 file)
>> +                  file))))
>
> Newlines are valid in filenames, though.

Ops sorry, I think I wanted to write (one-or-more (not eos))

> Maybe start with the file
> name extension function?
>
>  (when (equal (file-name-extension file) "gz")
>    (let ((filenogz (file-name-sans-extension file)))
>      (when (string-match-p "\\.el\\'" filenogz)
>        (setq file filenogz))))

I like this approach.

> As a by-product, that will also support filenames with version
> strings attached.

Like?

> (Assuming that's a good thing here.)
>
> (Also: Maybe not a practical issue here, but if Emacs supports
> loading compressed elisp files using any compression format
> besides .gz then maybe this should be more general.)

AFAIK we only support .gz

Thanks

  Andrea