Re: [Python-mode] py-execute-buffer and CWD

2011-11-02 Thread Georg Brandl
Am 01.11.2011 21:53, schrieb Andreas Röhler: > Am 01.11.2011 12:33, schrieb Andrea Crotti: >> While trying to run a script and there is already another *Python* >> buffer open >> for another directory, running the script normally fails if there are some >> relative file paths. >> >> Apparently the

Re: [Python-mode] py-execute-buffer and CWD

2011-11-01 Thread Andreas Röhler
Am 01.11.2011 23:33, schrieb Andrea Crotti: [ ... ] Another partially unrelated thing, I noticed the two following: (defun py-execute-buffer-no-switch (&optional async) "Like `py-execute-buffer', but ignores setting of `py-shell-switch-buffers-on-execute', output-buffer will being switched to."

Re: [Python-mode] py-execute-buffer and CWD

2011-11-01 Thread Andreas Röhler
Am 01.11.2011 22:51, schrieb Georg Brandl: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 01.11.2011 22:50, schrieb Andrea Crotti: On 11/01/2011 08:53 PM, Andreas Röhler wrote: cd is a shell command you can't mix that into Emacs Lisp. BTW ipython shell would understand "cd" it, but that's

Re: [Python-mode] py-execute-buffer and CWD

2011-11-01 Thread Andrea Crotti
So from my understading the problem is that if there is another *Python* buffer around, it will just be used without changing the current directory. Apparently my attempt to "cd" didn't have any effect, so maybe we need to pass the path of the master py file to the real "execute" function, does

Re: [Python-mode] py-execute-buffer and CWD

2011-11-01 Thread Georg Brandl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 01.11.2011 22:50, schrieb Andrea Crotti: > On 11/01/2011 08:53 PM, Andreas Röhler wrote: >> cd is a shell command >> >> you can't mix that into Emacs Lisp. >> >> BTW ipython shell would understand "cd" it, but that's another item. >> >> Maybe giv

Re: [Python-mode] py-execute-buffer and CWD

2011-11-01 Thread Andrea Crotti
On 11/01/2011 08:53 PM, Andreas Röhler wrote: cd is a shell command you can't mix that into Emacs Lisp. BTW ipython shell would understand "cd" it, but that's another item. Maybe give a example, what you trying to do, so we can look how to solve that task. BTW answered here, as you are not

Re: [Python-mode] py-execute-buffer and CWD

2011-11-01 Thread Andreas Röhler
Am 01.11.2011 12:33, schrieb Andrea Crotti: While trying to run a script and there is already another *Python* buffer open for another directory, running the script normally fails if there are some relative file paths. Apparently the CWD in the *Python* buffer remains the old one, and thus it ma

Re: [Python-mode] py-execute-buffer and CWD

2011-11-01 Thread Andreas Röhler
Am 01.11.2011 12:33, schrieb Andrea Crotti: While trying to run a script and there is already another *Python* buffer open for another directory, running the script normally fails if there are some relative file paths. Apparently the CWD in the *Python* buffer remains the old one, and thus it ma

[Python-mode] py-execute-buffer and CWD

2011-11-01 Thread Andrea Crotti
While trying to run a script and there is already another *Python* buffer open for another directory, running the script normally fails if there are some relative file paths. Apparently the CWD in the *Python* buffer remains the old one, and thus it makes sense that Python can't resolve relative