aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el23
1 files changed, 13 insertions, 10 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index dfefe837569..122f4ec9460 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -158,13 +158,13 @@
158;; (python-shell-exec-path . ("/path/to/env/bin/")) 158;; (python-shell-exec-path . ("/path/to/env/bin/"))
159 159
160;; Since the above is cumbersome and can be programmatically 160;; Since the above is cumbersome and can be programmatically
161;; calculated, the variable `python-shell-virtualenv-path' is 161;; calculated, the variable `python-shell-virtualenv-root' is
162;; provided. When this variable is set with the path of the 162;; provided. When this variable is set with the path of the
163;; virtualenv to use, `process-environment' and `exec-path' get proper 163;; virtualenv to use, `process-environment' and `exec-path' get proper
164;; values in order to run shells inside the specified virtualenv. So 164;; values in order to run shells inside the specified virtualenv. So
165;; the following will achieve the same as the previous example: 165;; the following will achieve the same as the previous example:
166 166
167;; (setq python-shell-virtualenv-path "/path/to/env/") 167;; (setq python-shell-virtualenv-root "/path/to/env/")
168 168
169;; Also the `python-shell-extra-pythonpaths' variable have been 169;; Also the `python-shell-extra-pythonpaths' variable have been
170;; introduced as simple way of adding paths to the PYTHONPATH without 170;; introduced as simple way of adding paths to the PYTHONPATH without
@@ -1838,7 +1838,7 @@ default `exec-path'."
1838 :group 'python 1838 :group 'python
1839 :safe 'listp) 1839 :safe 'listp)
1840 1840
1841(defcustom python-shell-virtualenv-path nil 1841(defcustom python-shell-virtualenv-root nil
1842 "Path to virtualenv root. 1842 "Path to virtualenv root.
1843This variable, when set to a string, makes the values stored in 1843This variable, when set to a string, makes the values stored in
1844`python-shell-process-environment' and `python-shell-exec-path' 1844`python-shell-process-environment' and `python-shell-exec-path'
@@ -1848,6 +1848,9 @@ virtualenv."
1848 :group 'python 1848 :group 'python
1849 :safe 'stringp) 1849 :safe 'stringp)
1850 1850
1851(define-obsolete-variable-alias
1852 'python-shell-virtualenv-path 'python-shell-virtualenv-root "25.1")
1853
1851(defcustom python-shell-setup-codes '(python-shell-completion-setup-code 1854(defcustom python-shell-setup-codes '(python-shell-completion-setup-code
1852 python-ffap-setup-code 1855 python-ffap-setup-code
1853 python-eldoc-setup-code) 1856 python-eldoc-setup-code)
@@ -2064,7 +2067,7 @@ uniqueness for different types of configurations."
2064 (mapconcat #'identity python-shell-process-environment "") 2067 (mapconcat #'identity python-shell-process-environment "")
2065 (mapconcat #'identity python-shell-extra-pythonpaths "") 2068 (mapconcat #'identity python-shell-extra-pythonpaths "")
2066 (mapconcat #'identity python-shell-exec-path "") 2069 (mapconcat #'identity python-shell-exec-path "")
2067 (or python-shell-virtualenv-path "") 2070 (or python-shell-virtualenv-root "")
2068 (mapconcat #'identity python-shell-exec-path ""))))) 2071 (mapconcat #'identity python-shell-exec-path "")))))
2069 2072
2070(defun python-shell-parse-command () ;FIXME: why name it "parse"? 2073(defun python-shell-parse-command () ;FIXME: why name it "parse"?
@@ -2089,12 +2092,12 @@ uniqueness for different types of configurations."
2089 extra))) 2092 extra)))
2090 2093
2091(defun python-shell-calculate-process-environment () 2094(defun python-shell-calculate-process-environment ()
2092 "Calculate process environment given `python-shell-virtualenv-path'." 2095 "Calculate process environment given `python-shell-virtualenv-root'."
2093 (let ((process-environment (append 2096 (let ((process-environment (append
2094 python-shell-process-environment 2097 python-shell-process-environment
2095 process-environment nil)) 2098 process-environment nil))
2096 (virtualenv (if python-shell-virtualenv-path 2099 (virtualenv (if python-shell-virtualenv-root
2097 (directory-file-name python-shell-virtualenv-path) 2100 (directory-file-name python-shell-virtualenv-root)
2098 nil))) 2101 nil)))
2099 (when python-shell-extra-pythonpaths 2102 (when python-shell-extra-pythonpaths
2100 (setenv "PYTHONPATH" (python-new-pythonpath))) 2103 (setenv "PYTHONPATH" (python-new-pythonpath)))
@@ -2108,12 +2111,12 @@ uniqueness for different types of configurations."
2108 process-environment)) 2111 process-environment))
2109 2112
2110(defun python-shell-calculate-exec-path () 2113(defun python-shell-calculate-exec-path ()
2111 "Calculate exec path given `python-shell-virtualenv-path'." 2114 "Calculate exec path given `python-shell-virtualenv-root'."
2112 (let ((path (append python-shell-exec-path 2115 (let ((path (append python-shell-exec-path
2113 exec-path nil))) ;FIXME: Why nil? 2116 exec-path nil))) ;FIXME: Why nil?
2114 (if (not python-shell-virtualenv-path) 2117 (if (not python-shell-virtualenv-root)
2115 path 2118 path
2116 (cons (expand-file-name "bin" python-shell-virtualenv-path) 2119 (cons (expand-file-name "bin" python-shell-virtualenv-root)
2117 path)))) 2120 path))))
2118 2121
2119(defvar python-shell--package-depth 10) 2122(defvar python-shell--package-depth 10)