Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!bloom-beacon!mgm.mit.edu!wolfgang From: wolfgang@mgm.mit.edu.UUCP Newsgroups: comp.emacs Subject: Re: cdpath in shell mode Message-ID: <1713@bloom-beacon.MIT.EDU> Date: Fri, 30-Oct-87 01:18:04 EST Article-I.D.: bloom-be.1713 Posted: Fri Oct 30 01:18:04 1987 Date-Received: Sat, 31-Oct-87 17:46:34 EST References: <8710291857.AA09540@ametek.COM> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: wolfgang@mgm.mit.edu (Wolfgang Rupprecht) Organization: Independent Software Consultant Lines: 25 In article <8710291857.AA09540@ametek.COM> david@ametek.COM (David Lim) writes: >I would like to enhance the way shell-set-directory works to recognize >cdpath, and switches to popd and pushd (as in pushd +2). The shell directory watching stuff is relatively easy to fool. Its basically impossible for emacs to really know where the shell is at without doing much of the work of the shell. For example: cd $foo What is the poor shell directory watcher to do? You can have emacs evaluate $foo with (getenv "foo"), but this is the wrong variable "foo". It is the foo in emacs's own environment. Someone could have done a "foo=/usr/tmp" in the shell. Watch all setting of variables, and record their current values? It becomes involved when people do "eval `tset ... `" or ". foo". Watching the shell is probably not worth the trouble. Why not just have the emacs shell stuff emit a 'pwd' down the connection and note the result? This works well, if you note the prompt when the shell starts up, and only emit the "pwd" when you see the prompt. Wolfgang Rupprecht UUCP: mirror!mit-mgm!wolfgang ARPA: wolfgang@mgm.mit.edu (IP addr 18.82.0.114)