[IPython-User] launch/run IPython in emacs buffer

Richard Everson R.M.Everson@exeter.ac...
Thu Sep 30 15:06:16 CDT 2010


Tom,
> 
> * I'd like also to be able to open an IPython buffer from anywhere (in
>  emacs), since I often use IPython as a calculator and scratchpad.

M-x py-shell 

will get you a new (I)Python shell.


> 1 fix M-p in IPython in shell-mode. When I run IPython in emacs shell
>  mode (i.e. running `ipython` from a prompt after running `M-x shell`),
>  IPython runs (with correct prompt, thanks Andrew Wilson). But when I
>  attempt to scroll IPython history (with M-p at the IPython prompt), I
>  instead get bash history. Is there a way to make shell-mode pass the
>  M-p event to IPython?

This works for me in the sense that I get history from emacs (via comint) rather than IPython's history, which works pretty well.  It sounds to me as if comint (which is responsible for running IPython) is picking up your bash shell history. In fact if I have a running IPython shell and then start a new zsh with M-x shell, type a couple of shell commands to the shell and then use M-p to get the history,  I get the shell commands and followed by my most recent IPython commands and switching buffers to IPython and using M-p gives me the shell commands and then the IPython history.  It looks to me as if you might do something like what's on the emacswiki: http://www.emacswiki.org/emacs/UsingMultipleShells , but I'm afraid I haven't time right now to try it.

Best,
Richard Everson.






More information about the IPython-User mailing list