From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: init_buffer PWD fix Date: Wed, 24 Apr 2002 12:19:03 -0700 (PDT) Sender: emacs-devel-admin@gnu.org Message-ID: <200204241919.g3OJJ3104590@shade.twinsun.com> References: <8296-Wed24Apr2002190326+0300-eliz@is.elta.co.il> NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1019676114 29159 127.0.0.1 (24 Apr 2002 19:21:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 24 Apr 2002 19:21:54 +0000 (UTC) Cc: emacs-devel@gnu.org, knagano@sodan.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 170SKw-0007aC-00 for ; Wed, 24 Apr 2002 21:21:54 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 170SMj-0002te-00 for ; Wed, 24 Apr 2002 21:23:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 170SKb-0005y8-00; Wed, 24 Apr 2002 15:21:33 -0400 Original-Received: from alcor.twinsun.com ([198.147.65.9]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 170SIE-0005Vc-00 for ; Wed, 24 Apr 2002 15:19:06 -0400 Original-Received: from shade.twinsun.com ([192.54.239.27]) by alcor.twinsun.com (8.12.1/8.12.1) with ESMTP id g3OJJ3Pd018564; Wed, 24 Apr 2002 12:19:03 -0700 (PDT) Original-Received: (eggert@localhost) by shade.twinsun.com (8.11.6+Sun/8.11.6) id g3OJJ3104590; Wed, 24 Apr 2002 12:19:03 -0700 (PDT) Original-To: himi@meadowy.org In-Reply-To: (himi@meadowy.org) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:3212 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:3212 > From: MIYASHITA Hisashi(=?ISO-2022-JP?B?GyRCNVwyPBsoQiAbJEI+MBsoQjpISU1J?=) > > Date: Thu, 25 Apr 2002 02:13:30 +0900 > I can imagin many bad situations. Suppose the following > situation as an example. > > (1) sh or tcsh set "PWD" and the current directory to "c:/PROGRA~1" This should happen only if either: A) the user types "cd c:/PROGRA~1"; or B) getcwd returns "c:/PROGRA~1" when sh starts up. In case A), the user has indicated a preference for the name "c:/PROGRA~1", so that is a better name for Emacs to use. In case B), there's no difference between using PWD and using getcwd, so there's no problem. > On Windows, however, it's not only useless but also harmful, I think. I don't see any extra harm in Windows. The situation is similar to that on Unix. The Unix convention is that PWD is the preferred name for the working directory. Most Unix shells obey this convention. A few older shells don't, and in that case the user gets a name other than the preferred name; but the name still works so it's not a major problem. Windows seems quite similar here, once we fix the bug in w32.c. > The above case is an example to affirm relying on "PWD" by obscure > convension is maybe harmful. It's not an obscure convention; it's in the POSIX standard. All other things being equal, it's better for w32.c to provide POSIX behavior; that isolates the Windows-specific stuff into w32.c instead of requiring Windows-specific changes to the rest of the code. eliz has proposed a fix along those lines, and this seems preferable to me as well. > From: MIYASHITA Hisashi(=?ISO-2022-JP?B?GyRCNVwyPBsoQiAbJEI+MBsoQjpISU1J?=) > > Date: Thu, 25 Apr 2002 03:25:57 +0900 > > But "PWD" is NOT cared by almost all of the Windows application. > On the contrary, Get/SetCurrentDirectory() is always cared. This is like Unix. On Unix, most applications don't use $PWD; they use the working directory. The only applications that set and use $PWD are those that care about using a "nice" name for the working directory. The situations seem to be analogous. In both systems, you can have multiple names for the same directory (because of symbolic links, or file name mangling, or backslashifying, or whatever). It's nice to use the user's preferred name for a directory even if it is not canonical, and $PWD is the standard way to do this.