Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
abingham opened this issue Oct 18, 2018 · 2 comments

Comments

@abingham
Copy link
Contributor

abingham commented Oct 18, 2018

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.

@jorgenschaefer
Copy link
Owner

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! :-)

@abingham
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants