Bugs item #1448154, was opened at 2006-03-12 00:56 Message generated for change (Comment added) made by edloper You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=1448154&group_id=86916
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nicholas Sandow (njsand) Assigned to: Nobody/Anonymous (nobody) Summary: Setting py-python-command after M-x py-shell doesn't work Initial Comment: If I do M-x py-shell, I get an error: "Searching for program: no such file or directory, python" That's ok, I just need to set `py-python-command', right? (setq py-python-command "c:/python24/python.exe") Then I do M-x py-shell again, I get the same error message: "Searching for program: no such file or directory, python" Why didn't setting py-python-command work? However, if I switch to another buffer, (actually a buffer in which I haven't tried M-x py-shell before setting `py-python-command') M-x py-shell will now work. ---------------------------------------------------------------------- >Comment By: Edward Loper (edloper) Date: 2006-03-12 14:47 Message: Logged In: YES user_id=195958 There's a buffer-local variable "py-which-shell," which is used to record what shell command you're using (and also "py-which-args"); this gets initialized the first time you run py-shell. It appears that the reasoning behind this has to do with toggling between cpython and jython, but it's not entirely clear to me from looking at the code. One way to make things a little more user friendly would be to add an initializer function to the defcustom that defines py-python-command, that calls "(py-toggle- shells 'cpython)"; but in your case, that wouldn't have helped, since you directly modified py-python-command using setq, rather than customize-variable. If you just want to get things working in that one buffer, the following should work: (setq py-python-command "c:/python24/python.exe") (py-toggle-shells 'cpython) ---------------------------------------------------------------------- Comment By: Edward Loper (edloper) Date: 2006-03-12 14:35 Message: Logged In: YES user_id=195958 There's a buffer-local variable "py-which-shell," which is used to record what shell command you're using (and also "py-which-args"); this gets initialized the first time you run py-shell. It appears that the reasoning behind this has to do with toggling between cpython and jython, but it's not entirely clear to me from looking at the code. One way to make things a little more user friendly would be to add an initializer function to the defcustom that defines py-python-command, that calls "(py-toggle- shells 'cpython)"; but in your case, that wouldn't have helped, since you directly modified py-python-command using setq, rather than customize-variable. If you just want to get things working in that one buffer, the following should work: (setq py-python-command "c:/python24/python.exe") (py-toggle-shells 'cpython) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=1448154&group_id=86916 _______________________________________________ Python-mode mailing list Python-mode@python.org http://mail.python.org/mailman/listinfo/python-mode