Allow WORKON_HOME environment variable to be overwritten

When running this Emacs configuration on different hosts (with different
operating systems …), virtual environments for Python may be available in
different locations.  So we allow the environment in which Emacs is started in
to overwrite the value of WORKON_HOME to accomodate for this.
This commit is contained in:
Daniel Borchmann 2021-04-24 09:49:55 +02:00
parent 36a1693610
commit 277c360914
Signed by: exot
GPG Key ID: 1C7071A75BB72D64

View File

@ -3005,7 +3005,8 @@ With given ARG, display files in `db/important-document-path."
(use-package pyvenv
:ensure t
:commands (pyvenv-workon pyvenv-activate)
:init (setenv "WORKON_HOME" (expand-file-name "~/.pyenv/versions"))
:init (unless (getenv "WORKON_HOME")
(setenv "WORKON_HOME" (expand-file-name "~/.pyenv/versions")))
:config (progn
;; Restart python inferior processes when switching virtual
;; environments; this does not work when only calling