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: Sat, 12 Aug 2023 13:03:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

>> > But the situation now is bad already: if I call
>> > file-name-as-directory, for example, with a relative file name in a
>> > remote directory, the handler is not invoked.  Isn't that a bug?
>>
>> Perhaps. But in practice, I'm not aware of bug reports about.
>
> It's a ticking time bomb.

Perhaps. A ticking bomb for at least 34 years, when ange-ftp.el was added.

>> However, we cannot call Fexpand_file_name in Ffind_file_name_handler,
>> because expand-file-name supports also file name handlers. This would be
>> an infloop. And just binding file-name-handler-alist to nil doesn't
>> return the proper result, but a result which is similar only:
>
> We don't need to call expand-file-name in find-file-name-handler,
> unless both the file name and default-directory are non-absolute.

default-directory must be absoöute per spec. If somebody uses a relative
file name, and a relative default-directory by intention (let-bound, for
example), I don't see a way to support file name handlers which need an
absolute file name for check. I simply don't know how to expand a
relative default-directory.

>> --8<---------------cut here---------------start------------->8---
>> (let ((default-directory "/ssh::")
>>       file-name-handler-alist)
>>   (expand-file-name "123"))
>>
>> => "c:/ssh::/123"
>> --8<---------------cut here---------------end--------------->8---
>
> Something to fix, I guess.  I see no insoluble issues here, FWIW.

We could use a variation of file-name-concat inside
Ffind_file_name_handler, when FILENAME is relative.

Best regards, Michael.



reply via email to

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