GithubHelp home page GithubHelp logo

Comments (4)

dwa avatar dwa commented on August 20, 2024

Hi @wtianyi.
Thanks, I believe you might be right. The problem I had with switch-to-buffer was that after opening a file, I had to jump to another buffer and then back again for the conda-env-autoactivate-mode to do its job.
But now that you brought it up, I did some testing and noticed that conda-current-name gets the wrong value (with pop-to-buffer) when jumping between buffers that use different conda envs. This seem to work better with switch-to-buffer.

But what is the right solution to activating conda on the opening of a file?

As a workaround, I added conda-env-activate-for-buffer to find-file-hook:

(use-package conda
  :hook
  (find-file . conda-env-activate-for-buffer)
  :config
  (conda-env-initialize-eshell)
  (conda-env-autoactivate-mode t)
  :ensure t)

So maybe that commit should be reverted, neither solution seem perfect, but at least the problem with switch-to-buffer can be worked around.

from conda.el.

wtianyi avatar wtianyi commented on August 20, 2024

Thanks for your detailed explanation and tests! @dwa

I do resonate with you on the problem that the environment is not auto-activated on the opening of a file, and I too don't have a satisfying solution.

I was thinking that maybe there is some way to make "conda.el" work with "projectile" so that the conda environment is consistent and set "per project". But I have not nearly enough knowledge about "projectile" to make any proposals.

Thanks for your workaround with find-file-hook too!

from conda.el.

wtianyi avatar wtianyi commented on August 20, 2024

I'm closing the issue. Should I have a better idea about projectile I'll potentially open a new issue or pull request.

from conda.el.

wtianyi avatar wtianyi commented on August 20, 2024

Referring related open issues #29 #64 #81

from conda.el.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.