diff options
author | Fabián Ezequiel Gallina <fgallina@gnu.org> | 2015-07-06 20:08:01 -0300 |
---|---|---|
committer | Fabián Ezequiel Gallina <fgallina@gnu.org> | 2015-07-06 20:08:01 -0300 |
commit | 287bce988895b104c33d53faacfffd91d8d8e0f1 (patch) | |
tree | 12f0c391ede2b76180ff9088f79c5229137a986e /lisp | |
parent | 60ea900848ee03e1ccdba565220f589e0d8e72e9 (diff) | |
download | emacs-287bce988895b104c33d53faacfffd91d8d8e0f1.tar.gz emacs-287bce988895b104c33d53faacfffd91d8d8e0f1.tar.bz2 emacs-287bce988895b104c33d53faacfffd91d8d8e0f1.zip |
python.el: Fix local/remote shell environment setup
* lisp/progmodes/python.el (python-shell-with-environment): Fix
remote/local environment setup.
* test/automated/python-tests.el (python-shell-with-environment-1)
(python-shell-with-environment-2): New tests.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/progmodes/python.el | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 1c0f105ceaa..95814fabca3 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2060,23 +2060,24 @@ execution of body. If `default-directory' points to a remote machine then modifies `tramp-remote-process-environment' and `tramp-remote-path' instead." (declare (indent 0) (debug (body))) - (let ((remote-p (file-remote-p default-directory))) - `(let ((process-environment - (if ,remote-p - process-environment - (python-shell-calculate-process-environment))) - (tramp-remote-process-environment - (if ,remote-p - (python-shell-calculate-process-environment) - tramp-remote-process-environment)) - (exec-path - (if ,remote-p - (python-shell-calculate-exec-path) - exec-path)) - (tramp-remote-path - (if ,remote-p - (python-shell-calculate-exec-path) - tramp-remote-path))) + (let ((remote-p (make-symbol "remote-p"))) + `(let* ((,remote-p (file-remote-p default-directory)) + (process-environment + (if ,remote-p + process-environment + (python-shell-calculate-process-environment))) + (tramp-remote-process-environment + (if ,remote-p + (python-shell-calculate-process-environment) + tramp-remote-process-environment)) + (exec-path + (if ,remote-p + exec-path + (python-shell-calculate-exec-path))) + (tramp-remote-path + (if ,remote-p + (python-shell-calculate-exec-path) + tramp-remote-path))) ,(macroexp-progn body)))) (defvar python-shell--prompt-calculated-input-regexp nil |