Subject: bug#74040: `require-with-check` signals error for `project`

From: Stefan Kangas <[email-masked]>
Date: Sun, 27 Oct 2024 14:24:01 -0700

Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <[email-masked]> writes:

>> One approach is to expose the `prefer` option of `openp` to
>> `locate-file` so we can use it in `require-with-check`, as in the
>> patch below.
>
> Another is to replace the `assoc` check with one that is more lenient,
> ignoring difference in file extensions.  E.g. the patch below.
> This makes the change more localized, at the cost of making
> `require-with-check` slower and less strict.

Either patch is fine by me, but having the change more localized is
certainly nice.

Do you have any other use case in mind for the new PREFER-NEWER argument
of `locate-file` than `require-with-check`?  If not, perhaps we should
avoid making it more complex?