-
Notifications
You must be signed in to change notification settings - Fork 28
Make auto-workon work with text files containing virtualenv name #45
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,8 +114,15 @@ Set your common venvs names in `venv-dirlookup-names'" | |
| (--map (concat (projectile-project-root) it) | ||
| venv-dirlookup-names)))) | ||
| (when path | ||
| (setq venv-current-name path) ;; there's really nothing that feels good to do here ;_; | ||
| (venv--activate-dir path)))) | ||
| ;; If the PATH is a regular and readable file, read the first | ||
| ;; string in this file and use it to active the virtualenv. | ||
| (if (and path (file-regular-p path) (file-readable-p path)) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add a comment here clarifying what this code does? Doesn't have to be long, I just find
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a comment.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perfect! |
||
| (with-temp-buffer | ||
| (insert-file-contents path) | ||
| (venv-workon (car (split-string (buffer-string) "\n" t)))) | ||
| ;; PATH is not a file, assume it's a virtualenv directory and activate it | ||
| (setq venv-current-name path) ;; there's really nothing that feels good to do here ;_; | ||
| (venv--activate-dir path))))) | ||
|
|
||
|
|
||
| ;; internal utility functions | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, could you check "allow edits from maintainers". There's a couple clarifications I'd like to make to this documentation that are probably easier for me to just do than to explain :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Allow edits from maintainers" is checked. Edit away :)