From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Null filename ("") is considered to correspond to an existing, readable, and writable file? Date: Mon, 2 Jan 2006 22:41:51 -0600 (CST) Message-ID: <200601030441.k034fpG26165@raven.dms.auburn.edu> References: NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1136263474 7650 80.91.229.2 (3 Jan 2006 04:44:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 3 Jan 2006 04:44:34 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 03 05:44:31 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 1Ete29-0000eJ-Lt for ged-emacs-devel@m.gmane.org; Tue, 03 Jan 2006 05:44:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ete3l-0006pI-E2 for ged-emacs-devel@m.gmane.org; Mon, 02 Jan 2006 23:46:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ete3Z-0006oj-BK for emacs-devel@gnu.org; Mon, 02 Jan 2006 23:45:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ete3X-0006oW-RH for emacs-devel@gnu.org; Mon, 02 Jan 2006 23:45:57 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ete3X-0006oT-Oj for emacs-devel@gnu.org; Mon, 02 Jan 2006 23:45:55 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Ete4h-0002BP-TA for emacs-devel@gnu.org; Mon, 02 Jan 2006 23:47:08 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.13.3+Sun/8.13.3) with ESMTP id k034iElk011168; Mon, 2 Jan 2006 22:44:14 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id k034fpG26165; Mon, 2 Jan 2006 22:41:51 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: drew.adams@oracle.com In-reply-to: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.1 (manatee.dms.auburn.edu [131.204.53.104]); Mon, 02 Jan 2006 22:44:14 -0600 (CST) 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:48642 Archived-At: Drew Adams wrote: Fine. It should be documented. There are plenty of functions that take an absolute file-name argument, and others that take a relative file-name argument. The doc for these particular functions should say that the argument must be a relative file name. No, it does _not_ have to be a relative file name. It is _allowed_ to be. If you do not want a relative file name, then why do you specify one? Just start your filename with ~ or /. The _normal_ situation is that both are accepted. It are the exceptions that should be documented. And they should explicitly point out the case of "". All the more so because their names can easily mislead you into thinking that an argument of "" will return a nil result. Why do you absolutely want to create files with the empty string as name? It does not work, at least not on POSIX systems. Does it work on MS Windows? Besides, where is the section of the manual that says that, unless stated otherwise, all file-name arguments to functions are relative, and they are all relative to the `default-directory'? They are _not_ relative unless the docstring states otherwise. They are relative unless the file name specifies otherwise, that is, if the file name starts with / or ~. "" does not start with / or ~, hence it is relative. Read `(elisp)Relative File Names'. Yes, of course it does. So what? It talks about lists and faces too, but that doesn't mean that the doc for a function shouldn't specify what its arguments are. But a function taking lists or faces as arguments should not explain what lists and faces are. Beyond the doc, wouldn't you expect functions with these names to return nil for a "" argument? Of course not. If default-directory is "/mydir/", then "a" is the file "/mydir/a", the concatenation of /mydir/" and "a". Why would you expect "" to be anything else but "/mydir/", the concatenation of "/mydir/ and "" ?. Is it so that you can use (file-exists-p "") to test the existence of directory `default-directory'? Of course. What's the advantage of such a "feature"? That it makes sense and is consistent. Why is the design like this? Because it is logical and consistent. And it is POSIX's design, not Emacs'. Sincerely, Luc.