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

Env autoactivate doesn't work when using find-file #162

Open
GrqPnegre opened this issue Aug 28, 2024 · 1 comment
Open

Env autoactivate doesn't work when using find-file #162

GrqPnegre opened this issue Aug 28, 2024 · 1 comment
Assignees
Labels

Comments

@GrqPnegre
Copy link

When conda-env-autoactivate-mode t and opening a file in a directory containing environment.yml for the first time, the conda environment is not activated.

It appears that conda--switch-buffer-auto-activate is not being called as part of find-file.

$ emacs --version
GNU Emacs 30.0.50
Development version a470dfb7f8a0 on master branch; build date 2024-01-30.
(pkg-info-package-version 'conda)
(20240708 2135)

Possible fix:
Add conda--switch-buffer-auto-activate to find-file-hook.

@necaris necaris self-assigned this Aug 31, 2024
@samJcrawford
Copy link

I've had success adding conda--switch-buffer-auto-activate to the window-selection-change-functions hook, which also means I can remove the advice to switch-to-buffer. Does anyone know of cases where this wouldn't work as expected?

One downside is that this does cause a lot of message spam. If we did go for this option, I'd rewrite some of the switching functions to avoid calling message quite so much (perhaps writing to a hidden debug buffer?).

@necaris necaris added the bug label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants