pyvenv icon indicating copy to clipboard operation
pyvenv copied to clipboard

Have `pyvenv-workon` do nothing if the requested environment is already active

Open abingham opened this issue 7 years ago • 2 comments

Many of my projects have a .dir-locals.el that does something like this:

((nil . ((eval . (unless (and (boundp 'pyvenv-virtual-env-name) (equal pyvenv-virtual-env-name "my-project"))
                   (pyvenv-workon "my-project")))
         )))

I do this check because apparently magit opens a lot of buffers in some of its operations, and simply callinv pyvenv-workon in dir-locals made magit very, very slow.

Could we add a flag to pyvenv-workon that did something like this, i.e. do nothing if the requested environment is active? I'd be happy to do the work.

abingham avatar Oct 18 '18 18:10 abingham

Hm. Considering you can reset the environment using deactivate + workon, I think this is fine. If you want to do the work, please go ahead! :-)

jorgenschaefer avatar Nov 23 '18 09:11 jorgenschaefer

Excellent. I might even be able to get to it this weekend.

abingham avatar Nov 23 '18 11:11 abingham