diff options
| author | Fabián Ezequiel Gallina | 2014-11-14 03:26:08 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2014-11-14 03:26:08 -0300 |
| commit | eb976992367d5b265dc779d82af5948987ec6de3 (patch) | |
| tree | 3c7b7c9f1866bff1cd0b25488d314c23146cb576 | |
| parent | 3e517d349bffb8cd2c2b6ae718097d1a04bae929 (diff) | |
| download | emacs-eb976992367d5b265dc779d82af5948987ec6de3.tar.gz emacs-eb976992367d5b265dc779d82af5948987ec6de3.zip | |
Rename python-shell-virtualenv-path to fit GNU conventions
* lisp/progmodes/python.el (python-shell-virtualenv-root): Rename from
python-shell-virtualenv-path.
(python-shell-internal-get-process-name)
(python-shell-calculate-process-environment)
(python-shell-calculate-exec-path): Use it.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 23 |
2 files changed, 21 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c3ff8b6d0f6..c3b879ab5c5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-11-14 Fabián Ezequiel Gallina <fgallina@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/python.el (python-shell-virtualenv-root): Rename from | ||
| 4 | python-shell-virtualenv-path. | ||
| 5 | (python-shell-internal-get-process-name) | ||
| 6 | (python-shell-calculate-process-environment) | ||
| 7 | (python-shell-calculate-exec-path): Use it. | ||
| 8 | |||
| 1 | 2014-11-14 Eli Zaretskii <eliz@gnu.org> | 9 | 2014-11-14 Eli Zaretskii <eliz@gnu.org> |
| 2 | 10 | ||
| 3 | * bindings.el (search-map): Fix last change: don't use 'kbd' in | 11 | * bindings.el (search-map): Fix last change: don't use 'kbd' in |
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. |
| 1843 | This variable, when set to a string, makes the values stored in | 1843 | This 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) |