Browse Source

Update with-venv

master
10sr 6 years ago
parent
commit
75fa8b67e0
Signed by: 10sr GPG Key ID: 7BEC428194130EB2
1 changed files with 9 additions and 7 deletions
  1. +9
    -7
      emacs.el

+ 9
- 7
emacs.el View File

@@ -2035,13 +2035,15 @@ If dir is nil, execute BODY as usual."
(unwind-protect (unwind-protect
(progn (progn
(when ,dir (when ,dir
;; Do the same thing that bin/activate does
(setq exec-path
(cons (concat ,dir "/bin")
exec-path))
(setenv "VIRTUAL_ENV" ,dir)
(setenv "PATH" (concat ,dir "/bin:" (or (getenv "PATH") "")))
(setenv "PYTHONHOME"))
(let* ((dir (file-name-as-directory ,dir))
(bin (expand-file-name "bin" dir)))
;; Do the same thing that bin/activate does
(setq exec-path
(cons bin
exec-path))
(setenv "VIRTUAL_ENV" dir)
(setenv "PATH" (concat bin ":" (or (getenv "PATH") "")))
(setenv "PYTHONHOME")))
,@body) ,@body)
(setq process-environment (setq process-environment
--with-venv-process-environment-orig) --with-venv-process-environment-orig)


Loading…
Cancel
Save