From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Keiichiro Nagano (=?ISO-2022-JP?B?GyRCMUpMbjc9MGxPOhsoQg==?=) Newsgroups: gmane.emacs.devel Subject: Re: init_buffer PWD fix Date: Mon, 22 Apr 2002 15:49:00 +0900 Organization: Team Sodan (http://sodan.org/) Sender: emacs-devel-admin@gnu.org Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1019458283 20471 127.0.0.1 (22 Apr 2002 06:51:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 22 Apr 2002 06:51:23 +0000 (UTC) Cc: emacs-devel@gnu.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 16zXfW-0005K4-00 for ; Mon, 22 Apr 2002 08:51:22 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16zXg6-0004md-00 for ; Mon, 22 Apr 2002 08:51:59 +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 16zXfL-00086o-00; Mon, 22 Apr 2002 02:51:11 -0400 Original-Received: from fw1280219.kitanet.ne.jp ([210.237.128.219] helo=omni-engine.com) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16zXdI-0007xW-00 for ; Mon, 22 Apr 2002 02:49:04 -0400 Original-Received: from bed.omni-engine.com (localhost [127.0.0.1]) by omni-engine.com (Postfix) with ESMTP id 2D05AE54D0; Mon, 22 Apr 2002 15:49:01 +0900 (JST) Original-To: Eli Zaretskii In-Reply-To: User-Agent: Wanderlust/2.9.9 (Unchained Melody) EMY/1.13.9 (Art is long, life is short) LIMIT/1.14.7 (Fujiidera) APEL/10.3 Emacs/21.2.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) 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:2981 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2981 At Mon, 22 Apr 2002 10:03:22 +0300 (IDT), Eli Zaretskii wrote: > > init_buffer uses environmental variable PWD to identify current > > working directory. I think we should not use it on Windows. On > > Windows with Cygwin, PWD is unreliable and confusing, because > > > > * Cygwin bash treats it > > * Cygwin sh (ash) doesnot > > * to say nothing of command.com, cmd.exe, nmake.exe and so on > > Sorry, I don't understand the problem. command.com. cmd.exe etc. don't > set PWD, so the current Emacs code should DTRT. I don't know about ash; > are you saying that it sets PWD to the wrong value? No. Cygwin sh (ash) is a lightweight Bourne shell, which does not update PWD even when it does chdir. Child processes inherit environmental variables from their parent processes. So when you invoke ash from bash, and do 'cd' in ash, then you have an old and now wrong PWD. Same problems happen when you invoke command.com, cmd.exe, nmake.exe from the bash shell. > It's impossible to evaluate your suggestion without understanding the > details. Please describe those details. Thanks in advance. Ok. -- bash$ printenv PWD # in bash... /home # now i'm here bash$ cd work # chdir to work... bash$ printenv PWD # and PWD is updated /home/work # it's ok bash$ sh # invoke sh (ash)... sh$ cd .. # and chdir to /home... sh$ printenv PWD # how about the PWD? /home/work # Oh God! -- Same problems happen quite often when you 'make' Emacs Lisp products which have chdir in their 'Makefile's. -- Keiichiro Nagano