From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Null filename ("") is considered to correspond to an existing, readable, and writable file? Date: Tue, 03 Jan 2006 07:32:24 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1136266361 13423 80.91.229.2 (3 Jan 2006 05:32:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 3 Jan 2006 05:32:41 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 03 06:32:39 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Etemc-0000C6-Et for ged-emacs-devel@m.gmane.org; Tue, 03 Jan 2006 06:32:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EteoE-0002vO-Ai for ged-emacs-devel@m.gmane.org; Tue, 03 Jan 2006 00:34:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Eteo6-0002vI-G2 for emacs-devel@gnu.org; Tue, 03 Jan 2006 00:34:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Eteo3-0002uF-Ta for emacs-devel@gnu.org; Tue, 03 Jan 2006 00:34:02 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eteo3-0002uA-Q3 for emacs-devel@gnu.org; Tue, 03 Jan 2006 00:33:59 -0500 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EtepE-0000b3-7t for emacs-devel@gnu.org; Tue, 03 Jan 2006 00:35:12 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-66-95.inter.net.il [80.230.66.95]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id DHG41585 (AUTH halo1); Tue, 3 Jan 2006 07:32:16 +0200 (IST) Original-To: "Drew Adams" In-reply-to: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:48644 Archived-At: > From: "Drew Adams" > Date: Mon, 2 Jan 2006 19:27:56 -0800 > > Besides, where is the section of the manual that says that, unless stated > otherwise, all file-name arguments to functions are relative This is a basic notion of every filesystem: every file is relative to the current directory, unless it begins with the root directory string. I don't thing the Emacs manual should teach such basics. > and they are all relative to the `default-directory'? In Emacs, `default-directory' is the variable that stores the current directory that is in effect when you are in that file's buffer. The Emacs manual says in the node "File Names": Each buffer has a default directory which is normally the same as the directory of the file visited in that buffer. When you enter a file name without a directory, the default directory is used. If you specify a directory in a relative fashion, with a name that does not start with a slash, it is interpreted with respect to the default directory. The default directory is kept in the variable `default-directory', which has a separate value in every buffer. Clear enough? > Beyond the doc, wouldn't you expect functions with these names to return nil > for a "" argument? What's the purpose of not checking this case, correctly > applying the meaning of the function's name and returning nil? > > Is it so that you can use (file-exists-p "") to test the existence of > directory `default-directory'? What's the advantage of such a "feature"? > There are other, more readable ways to test that: (file-exists-p > default-directory), for instance. > > Sorry, I still don't get it. Why is the design like this? This was discussed here some months ago, although I couldn't find that thread in the few minutes I had to look for it.