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 14:01:14 -0700 (PDT) Sender: emacs-devel-admin@gnu.org Message-ID: <200204242101.g3OL1EE04666@shade.twinsun.com> References: <8296-Wed24Apr2002190326+0300-eliz@is.elta.co.il> <200204241919.g3OJJ3104590@shade.twinsun.com> <200204242021.g3OKLS704607@shade.twinsun.com> NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1019683105 10016 127.0.0.1 (24 Apr 2002 21:18:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 24 Apr 2002 21:18:25 +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 170U9h-0002bR-00 for ; Wed, 24 Apr 2002 23:18:25 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 170UBX-0005Xk-00 for ; Wed, 24 Apr 2002 23:20:19 +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 170U9a-00012K-00; Wed, 24 Apr 2002 17:18:18 -0400 Original-Received: from alcor.twinsun.com ([198.147.65.9]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 170Tt6-0008CH-00 for ; Wed, 24 Apr 2002 17:01:16 -0400 Original-Received: from shade.twinsun.com ([192.54.239.27]) by alcor.twinsun.com (8.12.1/8.12.1) with ESMTP id g3OL1FPd032329; Wed, 24 Apr 2002 14:01:15 -0700 (PDT) Original-Received: (eggert@localhost) by shade.twinsun.com (8.11.6+Sun/8.11.6) id g3OL1EE04666; Wed, 24 Apr 2002 14:01:14 -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:3219 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:3219 > From: MIYASHITA Hisashi > Date: Thu, 25 Apr 2002 05:41:37 +0900 > > I can't understand why you stick to "PWD" environment variable on Windows. > The information almost all of the application dose not set is so important? Yes, it's important; and once w32.c is fixed it will not be ignored. > On Unix, shell and lots of programs usually put "nicer" pathname to "PWD". > On Windows, most programs put "nicer" pathname to Get/SetCurrentDirectory(). On Windows, if I pass a string to SetCurrentDirectory, and then later inquire about the string with GetCurrentDirectory, do I always get the same string back, no matter how it was spelled? Or do some Windows platforms return a munged copy of the original string? If the latter, then there will be some cases where PWD will be nicer than GetCurrentDirectory. > Otherwise, would you really make convenience for few applications > that set "PWD". To make matters worse, because of such applications, > "PWD" may has wrong value Once w32.c is fixed, the worst that will happen is that Emacs will use some other name for the working directory, a name that the user specified at some point (though perhaps not the most recently). I don't see this as being a major problem, any more than I see that it's a major problem that a similar thing happens on Unix. > > On Solaris 8, the standard shell program /bin/sh is not a POSIX shell, > > and it does not set PWD. The situations are analogous. > > And then, why do you use getcwd() instead of "PWD" on Unix? It's because > getcwd() normalize pathname, and it's incovenient for many users, isn't it? Many applications use getcwd because of inertia: getcwd predates PWD. Also, PWD is more of a pain to get right, so many applications don't bother to use it since they don't display the name to the user; GNU 'tar' is in this category. However, programs like Emacs and the shells do tend to use PWD, because they often present the working directory's name to the user, and it's more important for them to use a "nice" name.