]> git.eshelyaron.com Git - emacs.git/commitdiff
Rename python-shell-virtualenv-path to fit GNU conventions
authorFabián Ezequiel Gallina <galli.87@gmail.com>
Fri, 14 Nov 2014 06:26:08 +0000 (03:26 -0300)
committerFabián Ezequiel Gallina <galli.87@gmail.com>
Fri, 14 Nov 2014 06:26:08 +0000 (03:26 -0300)
* 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.

lisp/ChangeLog
lisp/progmodes/python.el

index c3ff8b6d0f677f718f19707d087fdbc4ff23bb31..c3b879ab5c59461ebcf751b05de9a578fe347bb3 100644 (file)
@@ -1,3 +1,11 @@
+2014-11-14  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       * 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.
+
 2014-11-14  Eli Zaretskii  <eliz@gnu.org>
 
        * bindings.el (search-map): Fix last change: don't use 'kbd' in
index dfefe8375695623f008668453ccb42cd1ba90ce9..122f4ec9460c0e2b144f2733197902aecf500e93 100644 (file)
 ;; (python-shell-exec-path . ("/path/to/env/bin/"))
 
 ;; Since the above is cumbersome and can be programmatically
-;; calculated, the variable `python-shell-virtualenv-path' is
+;; calculated, the variable `python-shell-virtualenv-root' is
 ;; provided.  When this variable is set with the path of the
 ;; virtualenv to use, `process-environment' and `exec-path' get proper
 ;; values in order to run shells inside the specified virtualenv.  So
 ;; the following will achieve the same as the previous example:
 
-;; (setq python-shell-virtualenv-path "/path/to/env/")
+;; (setq python-shell-virtualenv-root "/path/to/env/")
 
 ;; Also the `python-shell-extra-pythonpaths' variable have been
 ;; introduced as simple way of adding paths to the PYTHONPATH without
@@ -1838,7 +1838,7 @@ default `exec-path'."
   :group 'python
   :safe 'listp)
 
-(defcustom python-shell-virtualenv-path nil
+(defcustom python-shell-virtualenv-root nil
   "Path to virtualenv root.
 This variable, when set to a string, makes the values stored in
 `python-shell-process-environment' and `python-shell-exec-path'
@@ -1848,6 +1848,9 @@ virtualenv."
   :group 'python
   :safe 'stringp)
 
+(define-obsolete-variable-alias
+  'python-shell-virtualenv-path 'python-shell-virtualenv-root "25.1")
+
 (defcustom python-shell-setup-codes '(python-shell-completion-setup-code
                                       python-ffap-setup-code
                                       python-eldoc-setup-code)
@@ -2064,7 +2067,7 @@ uniqueness for different types of configurations."
             (mapconcat #'identity python-shell-process-environment "")
             (mapconcat #'identity python-shell-extra-pythonpaths "")
             (mapconcat #'identity python-shell-exec-path "")
-            (or python-shell-virtualenv-path "")
+            (or python-shell-virtualenv-root "")
             (mapconcat #'identity python-shell-exec-path "")))))
 
 (defun python-shell-parse-command ()    ;FIXME: why name it "parse"?
@@ -2089,12 +2092,12 @@ uniqueness for different types of configurations."
       extra)))
 
 (defun python-shell-calculate-process-environment ()
-  "Calculate process environment given `python-shell-virtualenv-path'."
+  "Calculate process environment given `python-shell-virtualenv-root'."
   (let ((process-environment (append
                               python-shell-process-environment
                               process-environment nil))
-        (virtualenv (if python-shell-virtualenv-path
-                        (directory-file-name python-shell-virtualenv-path)
+        (virtualenv (if python-shell-virtualenv-root
+                        (directory-file-name python-shell-virtualenv-root)
                       nil)))
     (when python-shell-extra-pythonpaths
       (setenv "PYTHONPATH" (python-new-pythonpath)))
@@ -2108,12 +2111,12 @@ uniqueness for different types of configurations."
     process-environment))
 
 (defun python-shell-calculate-exec-path ()
-  "Calculate exec path given `python-shell-virtualenv-path'."
+  "Calculate exec path given `python-shell-virtualenv-root'."
   (let ((path (append python-shell-exec-path
                       exec-path nil)))  ;FIXME: Why nil?
-    (if (not python-shell-virtualenv-path)
+    (if (not python-shell-virtualenv-root)
         path
-      (cons (expand-file-name "bin" python-shell-virtualenv-path)
+      (cons (expand-file-name "bin" python-shell-virtualenv-root)
             path))))
 
 (defvar python-shell--package-depth 10)