GNU bug report logs - #78306
[PATCH] Skip the non-exists path when loading a file on Windows

Previous Next

Package: emacs;

Reported by: Lin Sun <sunlin7 <at> hotmail.com>

Date: Thu, 8 May 2025 00:25:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Full log


Message #20 received at 78306 <at> debbugs.gnu.org (full text, mbox):

From: Lin Sun <sunlin7 <at> hotmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>, Eli Zaretskii <eliz <at> gnu.org>,
 Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: "78306 <at> debbugs.gnu.org" <78306 <at> debbugs.gnu.org>
Subject: Re: bug#78306: [PATCH] Skip the non-exists path when loading a file
 on Windows
Date: Thu, 8 May 2025 14:46:42 +0000
Hi Eli, Stefan, Michael,

Thanks for all your comments that let me research more on this this patch, and the non-exists dir in path is not a bug, it do has risk on behavior changing, so this patch should not to be applied.   Removing non-exists dir from load-path is better way.


From: Eli Zaretskii <eliz <at> gnu.org>
Sent: Thursday, May 8, 2025 05:44 AM
> Thanks, but I'm against this change.  faccessat is a general-purpose
> function, so changing the errno it returns on Windows will affect a
> lot of places in Emacs, with consequences we cannot predict.

The errno was used on function file_directory_p after sys_faccessat for windows, other cases only use its return value. 

> If you want to skip directories that don't exist, or exist as files
> that are non-directories, IMO the right way is to modify the loop in
> openp such that in the following snippet:
....
> ... (We
> should also consider how likely it is that load-path will include
> non-directories or directories that don't exist.)

Yes, should check why non-exists dir in the load-path.

From: Michael Albinus <michael.albinus <at> gmx.de>
Sent: Thursday, May 8, 2025 07:38 AM
> I don't know whether the snippet above is also relevant for remote
> files. If yes, adding a call of file-accessible-directory-p might
> influence performance.

File related APIs on windows is slow, it will influence the perormance.


From: Stefan Monnier <monnier <at> iro.umontreal.ca>
Sent: Thursday, May 8, 2025 01:13 PM
> You don't say why you think it's a problem.  It's been doing that for
> decades, and it's quite common to have a non-existing directory in
> `load-path` (e.g. the `<ROOT>/share/emacs/<VERSION>/site-lisp` if you're
> running Emacs "in place") yet it's never been seen as a problem.

I use a emacs distribution which contains several non-exists dirs in the load-path, and I found the issue by investigate its performance; no bug related to this, just for performance concern. 


Please feel free to close this ticket. Thank you!



This bug report was last modified 22 days ago.

Previous Next


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