Subject: Re: bug#74289: 30.0.92; `require-with-check' fails on non-existing files

From: Daniel Mendler <[email-masked]>
Date: Mon, 11 Nov 2024 05:52:16 +0100

Stefan Monnier <[email-masked]> writes:

>>>> `require-with-check' fails since
>>>> 0aae02a3741c397d6952e3128d434827aca0f912 on non-existing files.
>>>>
>>>> See the CI run of the Compat test suite:
>>>>
>>>> https://github.com/emacs-compat/compat/actions/runs/11763132765/job/32766767667
>>>>
>>>> This call fails:
>>>>
>>>> (require-with-check 'compat-does-not-exist nil 'noerror)
>>>
>>> Oops, can you confirm that the patch below works for you?
>>
>> It does look correct :) Thanks.
>
> Than you, Daniel, pushed to `emacs-30`.
> Closing,

Hi Stefan,

I think there is one more bug a little bit later. prefix can be nil
here:

(while (and lh (let ((file (car-safe (car lh))))
  (not (and file (string-prefix-p prefix file)))))
   ...)

In order to check, simply eval this code:

(require-with-check 'compat-does-not-exist nil 'noerror)

Daniel