help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell-current-directory - other window command needed


From: Andreas Politz
Subject: Re: shell-current-directory - other window command needed
Date: Wed, 28 Oct 2009 17:14:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

The Quiet Center <thequietcenter@gmail.com> writes:

> 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 :)

(let (buf)
  (save-window-excursion
    (shell-current-directory-whatever)
    (setq buf (current-buffer)))
  (pop-to-buffer buf))

  
I guess this will work.

-ap





reply via email to

[Prev in Thread] Current Thread [Next in Thread]