From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: The Quiet Center Newsgroups: gmane.emacs.help Subject: shell-current-directory - other window command needed Date: Wed, 28 Oct 2009 08:34:46 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1256744518 31222 80.91.229.12 (28 Oct 2009 15:41:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Oct 2009 15:41:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 28 16:41:51 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N3Aek-0008Cr-Ur for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Oct 2009 16:41:51 +0100 Original-Received: from localhost ([127.0.0.1]:37281 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3Aek-0005EQ-AW for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Oct 2009 11:41:50 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!news.glorb.com!news2.glorb.com!postnews.google.com!m20g2000vbp.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 23 Original-NNTP-Posting-Host: 131.187.67.44 Original-X-Trace: posting.google.com 1256744086 10745 127.0.0.1 (28 Oct 2009 15:34:46 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 28 Oct 2009 15:34:46 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m20g2000vbp.googlegroups.com; posting-host=131.187.67.44; posting-account=CLTRiQoAAAATysyZI2zRzNDqH657kxk9 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729), gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:174225 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:69308 Archived-At: Hello, shell-current-directory is an emacs package which allows one to create a shell whose starting directory is the same as the buffer the command 'shell-current-directory' was invoked in. The code for the command is here: http://github.com/metaperl/emacs/blob/master/shell-current-directory.el#L92 What I would like to have is a command 'shell-current-directory-other- window' which does the same thing, but opens the shell in the other- window --- the window you would be in if you typed C-x o in the current window. I suppose one way to do it is to: 1 - save the current buffer (name?) as orig-buffer 2 - invoke shell-current-directory 3 - save the shell-buffer (name?) as new-shell-buffer 4 - switch-to-buffer orig-buffer 5 - other-window 6 - switch-to-buffer new-shell-buffer But I am not quite adept enough at elisp to do this :)