From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Troy Hinckley Newsgroups: gmane.emacs.devel Subject: Re: file-exists-p on empty string Date: Wed, 27 Feb 2019 08:29:45 -0700 Message-ID: References: <87pnrde2rm.fsf@gmx.de> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="72183"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Evgeny Zajcev , emacs-devel To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 27 16:43:48 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gz1N6-000IhP-ER for ged-emacs-devel@m.gmane.org; Wed, 27 Feb 2019 16:43:48 +0100 Original-Received: from localhost ([127.0.0.1]:46253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gz1N5-0001V6-CU for ged-emacs-devel@m.gmane.org; Wed, 27 Feb 2019 10:43:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gz1MU-0001UX-Eh for emacs-devel@gnu.org; Wed, 27 Feb 2019 10:43:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gz1MQ-0007uT-C6 for emacs-devel@gnu.org; Wed, 27 Feb 2019 10:43:08 -0500 Original-Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:34917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gz1MP-0006ia-So for emacs-devel@gnu.org; Wed, 27 Feb 2019 10:43:06 -0500 Original-Received: by mail-pf1-x430.google.com with SMTP id j5so8196469pfa.2 for ; Wed, 27 Feb 2019 07:40:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=N0qTGl1e1xwrT7Ogb2xX+mSlJtq4leiY+ewpJ1oqPSI=; b=PTcCuOuK3dBUySCsV0s7jHuH8pfSwFmdZ25okIj14MoIP3S0mG51C9z/XVq9Z4Ur/N mPXXnGMFQox8aGDj/25a1WirYmRcmerpg7/Aleo51uNziIh8KXg1Yef8LKiie4XFM1iD xC11a+7IG/hdF80NIom2amS9sR7YvaBqUr9DhYUGIBp/gamhoBe87d9YHzLlh4N017Ay H9F9ivn58nzU1V04e0QvxNNUEm/kzfI1mZBDNeurK4nIkU/T5uTbvuQPUCjx2IF5/ze5 sBmgcaTI+gdKAVhjjE9zfcNNHhgeXxX++quCvTO2Pk7XrS0+7p21Qx0PCr8AGsZgDjEq ViNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=N0qTGl1e1xwrT7Ogb2xX+mSlJtq4leiY+ewpJ1oqPSI=; b=GJQ+3yFJq4HbvsfXfJImlG7tB0W3qfeTtU2RiTuL+P19I4yX/RpN4MUCBPoDORNKqK oPXy9NmPmChPG/LEtBs5+ulXnHwMkulZCEUxPIhwJ4XQ5j2gbfHf03RdOP7QPmO/abs9 IzgGN34RC2o4xKB9HWXieB7L06Vp0TlPWfzyLE5q3SvtBqR9BkQ1ldun+esQpfVrH/ww 3Ydb2iOgjVu2ZSxUqCQD+7VsC7ZXf8ADO9Oi7vizU0MAjaeYIUq4YzOvxOWQrYyBYDTH kkWI7YWpDZFg8Z13wXRarnGtC0k9o7wstYyBMoprBwEEkHHPAReVnXA+z0w7ROmDMZpQ ExTw== X-Gm-Message-State: AHQUAuYqXHb+hef8yYxO+TH2FcGxS1D8moHFofuYoPwUZzj7J/K06vnr WRoxatihqt+mqiWLwJfIO3A= X-Google-Smtp-Source: AHgI3IayawLslNpQALbazO9fgPcQawm+Sa8ebSdw43XxHIawXZgqt1ivaBJMLIqGEmjyKXr431UR/A== X-Received: by 2002:a62:b801:: with SMTP id p1mr2207659pfe.25.1551281387947; Wed, 27 Feb 2019 07:29:47 -0800 (PST) Original-Received: from [10.170.26.161] ([192.55.54.60]) by smtp.gmail.com with ESMTPSA id e14sm1349746pga.61.2019.02.27.07.29.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 07:29:46 -0800 (PST) X-Mailer: iPhone Mail (16D57) In-Reply-To: <87pnrde2rm.fsf@gmx.de> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::430 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233649 Archived-At: I agree with Evgeny. A user would not normally expect (file-exists-p =E2=80=9C= =E2=80=9D) to return t. At least I wouldn=E2=80=99t.=20 - Troy Hinckley > On Feb 27, 2019, at 7:15 AM, Michael Albinus wrot= e: >=20 > Evgeny Zajcev writes: >=20 > Hi Evgeny, >=20 >> It was quite surprising for me that >>=20 >> (file-exists-p "") >> =3D=3D> t >>=20 >> I thought that `file-exists-p` resembles stat, such as >>=20 >> $ stat "" >> No such file or directory >>=20 >> This is because `file-exists-p` uses `expand-file-name`, which returns >> current directory for empty string >>=20 >> 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? >=20 > I believe the current behavior is correct. file-exists-p calls > expand-file-name, and (expand-file-name "") returns always > default-directory. >=20 >> Thanks >=20 > Best regards, Michael. >=20