Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emacs python-mode: designate which python shell to send commands to

A follow up on this question - if I have two python shells running in emacs, how can I designate which shell commands from each python script buffer is sent to? I suspect it has something to do with python-buffer and python-set-proc but setting these variables to the name of the shell is apparently not the solution.

Edit: actually since I am using python-mode rather than loveshack python, it probably does not have to do with python-buffer and python-set-proc.

like image 688
hatmatrix Avatar asked Jul 25 '26 03:07

hatmatrix


1 Answers

You can set a new value to python-buffer.

(defun my-python-set-proc (buffer-name)
  (interactive "B")
  (setf python-buffer (get-buffer buffer-name))
  (python-set-proc))

And then M-xmy-python-set-procRET*Python*RET, or M-xmy-python-set-procRET*Python*<2>RET.

like image 110
Daimrod Avatar answered Jul 28 '26 02:07

Daimrod