From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Shutko Newsgroups: gmane.emacs.help Subject: Re: shell mode, changing directory Date: Fri, 21 Mar 2003 19:53:02 GMT Organization: Optimum Online Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87d6kkjyoh.fsf@wesley.springies.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1048276758 31113 80.91.224.249 (21 Mar 2003 19:59:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 21 Mar 2003 19:59:18 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 21 20:59:15 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 18wSfb-00085I-00 for ; Fri, 21 Mar 2003 20:59:15 +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 18wScS-0001JF-06 for gnu-help-gnu-emacs@m.gmane.org; Fri, 21 Mar 2003 14:56:00 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshosting.com!news-xfer1.atl.newshosting.com!64.154.60.99.MISMATCH!c03.atl99!cyclone2.usenetserver.com!news.webusenet.com!news01.optonline.net!news4.srv.hcvlny.cv.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:FpXwMtGSdhbcXgs3kiPoSYsBhU4= Original-Lines: 23 Original-NNTP-Posting-Host: 24.47.114.19 Original-X-Trace: news4.srv.hcvlny.cv.net 1048276382 24.47.114.19 (Fri, 21 Mar 2003 14:53:02 EST) Original-NNTP-Posting-Date: Fri, 21 Mar 2003 14:53:02 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:111299 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:7798 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:7798 >>Specifically I want to write two commands. The first is "move CWD of >>shell to the same as the file of the current buffer" (currently you >>can achieve this, by killing the *shell* buffer, and typing M-x >>shell). Here's a sample for this request. It shouldn't be too hard to generalize this. (defun change-shell-wd-to-current () "Change the directory of the *shell* buffer to the current directory" (interactive) (save-excursion (let ((command (concat "cd " default-directory)) (process (get-buffer-process "*shell*"))) (set-buffer "*shell*") (goto-char (point-max)) (insert command) (comint-send-input)))) -- Alan Shutko - I am the rocks. Looking for a developer in St. Louis? http://web.springies.com/~ats/ "Why should I stop just because I've had more than enough?" Draco F.