* Restarting the python process in py-shell
@ 2011-02-25 18:40 Neilen Marais
0 siblings, 0 replies; only message in thread
From: Neilen Marais @ 2011-02-25 18:40 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
I'm using emacs 23.1.1 (from Ubuntu 10.10) and ipython using
ipython.el. I often need to re-start my interactive python process while
developing and wanted to define a single keybinding for this. I
experimented and found that the functions needed are
comint-quit-subjob and py-shell. I tried M-x comint-quit-subjob M-x
py-shell when in the *Python* buffer, and it worked OK. Then I tried to
make a function to do it, and included the following snippet in my
init.el:
(defun py-shell-restart-process ()
"Quit and restart current py-shell process"
(interactive)
(comint-quit-subjob)
(py-shell))
(add-hook 'py-shell-hook (lambda ()
(local-set-key "\C-cr" 'py-shell-restart-process)
))
Pressing C-cr kills the process, but for some reason doesn't re-start
the shell process. What am I doing wrong here?
Thanks
Neilen
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-02-25 18:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25 18:40 Restarting the python process in py-shell Neilen Marais
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).