all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: lg.zevlg@gmail.com
To: Robert Pluim <rpluim@gmail.com>
Cc: Michael Albinus <michael.albinus@gmx.de>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: file-exists-p on empty string
Date: Wed, 27 Feb 2019 22:40:41 +0300	[thread overview]
Message-ID: <636956CB-1279-4EFC-BF5C-92CD7C40CAA3@gmail.com> (raw)
In-Reply-To: <m2a7ihfd9a.fsf@gmail.com>


> 27 февр. 2019 г., в 18:43, Robert Pluim <rpluim@gmail.com> написал(а):
> 
> Michael Albinus <michael.albinus@gmx.de> writes:
> 
>> Evgeny Zajcev <lg.zevlg@gmail.com> writes:
>> 
>> Hi Evgeny,
>> 
>>> It was quite surprising for me that
>>> 
>>>  (file-exists-p "")
>>>  ==> t
>>> 
>>> I thought that `file-exists-p` resembles stat, such as
>>> 
>>>  $ stat ""
>>>  No such file or directory
>>> 
>>> This is because `file-exists-p` uses `expand-file-name`, which returns
>>> current directory for empty string
>>> 
>>> Would not it be more correct for `file-exists-p` to return `nil` for
>>> empty string, and if someone wants current directory he will use "."
>>> as filename?
>> 
>> 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.
> 

Yeah, exactly, I’m ok with the current behaviour if it was described in doc-string!

—
lg


  parent reply	other threads:[~2019-02-27 19:40 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27 12:29 file-exists-p on empty string Evgeny Zajcev
2019-02-27 14:15 ` Michael Albinus
2019-02-27 15:29   ` Troy Hinckley
2019-02-27 15:43   ` Robert Pluim
2019-02-27 16:01     ` Michael Albinus
2019-02-27 16:55       ` Eli Zaretskii
2019-02-27 18:09         ` Michael Albinus
2019-02-27 16:11     ` Eli Zaretskii
2019-02-27 16:16       ` Robert Pluim
2019-02-27 16:30     ` Andreas Schwab
2019-02-27 19:40     ` lg.zevlg [this message]
2019-02-27 15:53 ` Stefan Monnier
2019-02-27 16:00   ` Robert Pluim
2019-02-27 16:15     ` Stefan Monnier
2019-02-27 16:09 ` Eli Zaretskii
2019-02-27 18:42   ` lg.zevlg
2019-02-27 18:46     ` Eli Zaretskii
2019-02-27 19:04       ` lg.zevlg
2019-02-27 19:16         ` Eli Zaretskii
2019-02-27 19:29           ` lg.zevlg
2019-02-27 19:30         ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2019-02-27 20:07 lg.zevlg
2019-02-27 21:18 ` Stefan Monnier
2019-02-27 22:01   ` Drew Adams
2019-02-28  3:24     ` Stefan Monnier
2019-03-06  9:51   ` Michael Albinus
2019-03-08  6:11     ` Stefan Monnier
2019-03-09  8:48       ` Michael Albinus
2019-02-27 22:09 lg.zevlg
2019-02-27 22:23 ` Drew Adams
2019-02-27 22:41   ` Evgeny Zajcev
2019-02-27 23:23     ` Drew Adams
2019-02-28  0:08       ` Evgeny Zajcev
2019-02-28  1:16     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=636956CB-1279-4EFC-BF5C-92CD7C40CAA3@gmail.com \
    --to=lg.zevlg@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=rpluim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.