emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 400df210ce0: Fix last change of 'delete-file'


From: Michael Albinus
Subject: Re: master 400df210ce0: Fix last change of 'delete-file'
Date: Fri, 11 Aug 2023 19:24:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

> Primitives indeed _must_ call expand-file-name.  And expand-file-name
> does that with default-directory because it accepts a directory as its
> 2nd argument, and that argument defaults to default-directory.

Do you want two different versions of find-file-name-handler? One used
for primitives in C core which doesn't apply expand-file-name, and
another version for file operations in Lisp?

> The addition of expand-file-name to delete-file made that function a
> bit slower, and for local files that is a net loss.  We should extend
> instead find-file-name-handler to work for non-absolute file names to
> avoid this overhead.

It is not a recent addition, it has been there for ages. In Fdelete_file.

I vaguely remember that I've tried that approach many years ago, in my
early years working for Tramp. There were subtle bugs, hard to fix,
because of this. But I don't remember the details.

>> I wouldn't touch this as it works. Improvements in documentation might
>> be appreciated.
>
> Indeed, the fact that find-file-name-handler needs an absolute file
> name is never mentioned anywhere in the documentation.  It is strange
> this didn't pop up earlier.

find-file-name-handler does not need an absolute file name in
general. Several handlers are invoked based on the file name
extensions. It are the remote file names which require absolute file
names.

If we add expand-file-name for cases it isn't applied yet, Emacs might
become slower. And perhaps we introduce new faults by this, because
everybody has arranged with the current behavior.

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]