necaris / conda.el

Emacs helper library (and minor mode) to work with conda environments
MIT License
153 stars 49 forks source link

NotImplemented: Check for a per-directory local variable setting the conda-project-env-name #86

Closed BFAnas closed 2 years ago

BFAnas commented 3 years ago

Hello,

Thank you for the great module. I noticed that the following is not implemented (at least not on the master branch)

It's also common to want to have an environment automatically activated when you open a file in a certain project. This can be done with the conda-env-autoactivate-mode minor mode, which will:
   - check for a per-directory local variable setting the conda-project-env-name

This part of the code is putting it as a TODO, maybe it was implemented an then reversed...

(defun conda--read-env-name ()
  "Read environment name, prompting appropriately whether an env is active now."
  ;; TODO FEATURE: does this need to be inferred from the directory?
  (conda-env-read-name
   (format "Choose a conda environment%s: "
           (if conda-env-current-name
               (format " (currently %s)" conda-env-current-name)
             ""))))
benbovy commented 2 years ago

I seems that we can now set the conda env name via the conda-project-env-path variable (#97).

necaris commented 2 years ago

Can someone provide more details on what is not implemented? If I set conda-project-env-name in a .dir-locals.el file, I see this activate -- what are y'all doing differently?

benbovy commented 2 years ago

@necaris I don't see any variable conda-project-env-name defined in conda.el (main branch).

However, I see this https://github.com/necaris/conda.el/blob/214c347254cb71a39c368ccd1be54fe06898ae4b/conda.el#L591-L593

conda-project-env-path works for me.

necaris commented 2 years ago

Thanks @benbovy! Going to go ahead and close this since conda-project-env-path works and matches the README.