From 277c360914a34c71d513702350e67a8378b4b33b Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 24 Apr 2021 09:49:55 +0200 Subject: [PATCH] Allow WORKON_HOME environment variable to be overwritten MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 5fc294f..d71a1d9 100644 --- a/init.el +++ b/init.el @@ -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