From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Phillip Lord Newsgroups: gmane.emacs.help Subject: Re: shell mode, changing directory Date: 24 Mar 2003 12:40:34 +0000 Organization: BIOSCI/MRC Human Genome Mapping Project Resource Centre Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <3E7B3B46.1090204@ihs.com> <3E7B80F2.8000400@ihs.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1048509971 24982 80.91.224.249 (24 Mar 2003 12:46:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 24 Mar 2003 12:46:11 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 24 13:46:10 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18xRL8-0006Ul-00 for ; Mon, 24 Mar 2003 13:46:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18xRKG-0000fq-02 for gnu-help-gnu-emacs@m.gmane.org; Mon, 24 Mar 2003 07:45:16 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!peernews3.colt.net!newsfeed.stueberl.de!newsr1.ipcore.viaginterkom.de!btnet-peer1!btnet-feed3!btnet-peer0!btnet-peer!btnet!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!server1.netnews.ja.net!hgmp.mrc.ac.uk!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: bromine.hgmp.mrc.ac.uk Original-X-Trace: niobium.hgmp.mrc.ac.uk 1048509635 19719 193.62.192.35 (24 Mar 2003 12:40:35 GMT) Original-X-Complaints-To: news@net.bio.net Original-NNTP-Posting-Date: Mon, 24 Mar 2003 12:40:35 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.93 Original-Xref: shelby.stanford.edu gnu.emacs.help:111342 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:7844 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:7844 >>>>> "Kevin" == Kevin Rodgers writes: >> This appears to change the default directory of the buffer, not >> the >> current working directory of the shell, which is not really what >> I want. Kevin> Sorry, that's just what you asked for. I was a little unclear about what I wanted, I agree. >> Both need to happen. Kevin> Then do what comint-send-input (which is what RET is bound to Kevin> in the *shell* buffer) does: Kevin> (funcall comint-input-sender Kevin> (get-buffer-process (current-buffer)) (format "cd %s" Kevin> DIRECTORY)) Okay, yes, this works..... (process-send-string (get-buffer-process (current-buffer)) "cd ~\n") (cd "~") (insert-string "cd ~\n" )) which changes the current working directory of the shell, the buffer, and tells the user what has happened. Cheers Phil