[Top][All Lists]

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

Re: file-exists-p on empty string

From: Michael Albinus
Subject: Re: file-exists-p on empty string
Date: Wed, 27 Feb 2019 17:01:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Robert Pluim <address@hidden> writes:

>> I believe the current behavior is correct. file-exists-p calls
>> expand-file-name, and (expand-file-name "") returns always
>> default-directory.
> Thatʼs not described in the doc-string though, so itʼs surprising
> behaviour.

Agreed, shall be documented at least. But I'm pretty sure there's code
in the wild which depends on this behavior. Maybe not explicitly, but
via calling file-exists-p with an empty string, which has been computed somehow.

I would expect this for example for Tramp. Do we want to change such
basic behavior?

Btw, several other basic file name operations behave similar. Try
(file-attributes "") or (file-readable-p "") or (file-directory-p "") .

> Robert

Best regards, Michael.

reply via email to

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