[IPython-user] Question about ipython.el
Jouni K. Seppänen
jks@iki...
Fri May 11 04:14:42 CDT 2007
bruno <bruno.chazelas@ias.u-psud.fr> writes:
> here is the code I added to my .emacs :
Works for me; my Emacs claims to be "GNU Emacs 22.0.97.1
(i386-apple-darwin8.9.1, Carbon Version 1.6.0) of 2007-04-08 on
potato.local". What version of Emacs do you have?
> (setq oldbuf (current-buffer))
> (setq oldwindow (selected-window))
...
> (select-window oldwindow)
> (switch-to-buffer oldbuf)
A better way to do this is save-window-excursion:
(defun py-shell-stop-and-restart ()
"Stop and restart the current python process"
(interactive)
(save-window-excursion
(if (get-process "Python")
(progn (kill-process "Python")
(message "Python Killed"))
(message "Python is not running Yet")))
(py-shell))
--
Jouni K. Seppänen
http://www.iki.fi/jks
More information about the IPython-user
mailing list