Subject: bug#74040: closed (Re: bug#74040: `require-with-check` signals error for `project`)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 29 Oct 2024 02:43:02 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
74040: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74040
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#74040: `require-with-check` signals error for `project`
From: Stefan Monnier <[email-masked]>
To: Stefan Kangas <[email-masked]>
Cc: [email-masked]
Date: Mon, 28 Oct 2024 22:42:16 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

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

Agreed.

> 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?

In principle, it's nice to be able to reproduce *exactly* the search
performed by `load` and `require`, but in practice, I don't have any
real use case, no.

I pushed the more localized patch (after fixing it so it actually
works).

        Stefan

Subject: `require-with-check` signals error for `project`
From: Stefan Monnier <[email-masked]>
To: [email-masked]
Date: Sat, 26 Oct 2024 23:15:01 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Package: Emacs
Version: 30.0.50

1. Customize `load-prefer-newer` to t.
2. Edit project.el in-tree, save it, don't recompile Emacs.
3. Restart Emacs.
4. Visit some code file and try to launch `M-x eglot` there.

You should get an error along the lines of:

    require-with-check: Feature ‘project’ loaded from
    ".../lisp/progmodes/project.el" is now provided by
    ".../lisp/progmodes/project.elc"

This error is spurious.  AFAICT, it is due to the fact that
`require-with-check` uses `locate-file` to "guess" which file `load`
would use, but `locate-file` doesn't obey `load-prefer-newer`, so it
guesses wrong.

        Stefan