aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina2015-07-06 20:08:01 -0300
committerFabián Ezequiel Gallina2015-07-06 20:08:01 -0300
commit287bce988895b104c33d53faacfffd91d8d8e0f1 (patch)
tree12f0c391ede2b76180ff9088f79c5229137a986e /lisp/progmodes/python.el
parent60ea900848ee03e1ccdba565220f589e0d8e72e9 (diff)
downloademacs-287bce988895b104c33d53faacfffd91d8d8e0f1.tar.gz
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/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el35
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
2060machine then modifies `tramp-remote-process-environment' and 2060machine then modifies `tramp-remote-process-environment' and
2061`tramp-remote-path' instead." 2061`tramp-remote-path' instead."
2062 (declare (indent 0) (debug (body))) 2062 (declare (indent 0) (debug (body)))
2063 (let ((remote-p (file-remote-p default-directory))) 2063 (let ((remote-p (make-symbol "remote-p")))
2064 `(let ((process-environment 2064 `(let* ((,remote-p (file-remote-p default-directory))
2065 (if ,remote-p 2065 (process-environment
2066 process-environment 2066 (if ,remote-p
2067 (python-shell-calculate-process-environment))) 2067 process-environment
2068 (tramp-remote-process-environment 2068 (python-shell-calculate-process-environment)))
2069 (if ,remote-p 2069 (tramp-remote-process-environment
2070 (python-shell-calculate-process-environment) 2070 (if ,remote-p
2071 tramp-remote-process-environment)) 2071 (python-shell-calculate-process-environment)
2072 (exec-path 2072 tramp-remote-process-environment))
2073 (if ,remote-p 2073 (exec-path
2074 (python-shell-calculate-exec-path) 2074 (if ,remote-p
2075 exec-path)) 2075 exec-path
2076 (tramp-remote-path 2076 (python-shell-calculate-exec-path)))
2077 (if ,remote-p 2077 (tramp-remote-path
2078 (python-shell-calculate-exec-path) 2078 (if ,remote-p
2079 tramp-remote-path))) 2079 (python-shell-calculate-exec-path)
2080 tramp-remote-path)))
2080 ,(macroexp-progn body)))) 2081 ,(macroexp-progn body))))
2081 2082
2082(defvar python-shell--prompt-calculated-input-regexp nil 2083(defvar python-shell--prompt-calculated-input-regexp nil