all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Shutko <ats@acm.org>
Subject: Re: shell mode, changing directory
Date: Fri, 21 Mar 2003 19:53:02 GMT	[thread overview]
Message-ID: <87d6kkjyoh.fsf@wesley.springies.com> (raw)
In-Reply-To: mailman.3489.1048272184.21513.help-gnu-emacs@gnu.org

>>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 <ats@acm.org> - 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.

       reply	other threads:[~2003-03-21 19:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3489.1048272184.21513.help-gnu-emacs@gnu.org>
2003-03-21 19:53 ` Alan Shutko [this message]
2003-03-22  9:42 ` shell mode, changing directory Piet van Oostrum
2003-03-24 16:21   ` Phillip Lord
2003-03-21 18:40 Bingham, Jay
  -- strict thread matches above, loose matches on Subject: below --
2003-03-19 16:22 Phillip Lord
2003-03-21 16:18 ` Kevin Rodgers
2003-03-21 17:56   ` Phillip Lord
2003-03-21 18:11     ` Barry Margolin
2003-03-21 21:15     ` Kevin Rodgers
2003-03-24 12:40       ` Phillip Lord
2003-03-21 18:23 ` Alan Shutko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d6kkjyoh.fsf@wesley.springies.com \
    --to=ats@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.