GNU bug report logs - #74040
`require-with-check` signals error for `project`

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Sun, 27 Oct 2024 03:16:02 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#74040: closed (`require-with-check` signals error for `project`)
Date: Tue, 29 Oct 2024 02:43:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 28 Oct 2024 22:42:16 -0400
with message-id <jwvh68vk4x0.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#74040: `require-with-check` signals error for `project`
has caused the debbugs.gnu.org bug report #74040,
regarding `require-with-check` signals error for `project`
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
74040: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74040
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: `require-with-check` signals error for `project`
Date: Sat, 26 Oct 2024 23:15:01 -0400
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



[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 74040-done <at> debbugs.gnu.org
Subject: Re: bug#74040: `require-with-check` signals error for `project`
Date: Mon, 28 Oct 2024 22:42:16 -0400
> 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



This bug report was last modified 203 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.