help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hook for Environment Activation?


From: James K. Lowden
Subject: Re: Hook for Environment Activation?
Date: Wed, 9 Nov 2016 13:19:50 -0500

On Tue, 8 Nov 2016 16:02:03 -0800 (PST)
Brandeis King <brandeis.a.king@gmail.com> wrote:

> I'm using Anaconda's environments to manage various python packages,
> including linters or "checkers" and I'm using Flycheck to perform
> code linting. When an environment is activated, I'd like to have
> Emacs respond to the activation by setting the Flycheck "checker"
> path. 

I don't know the best answer to your question, but I can simplify it
for those unfamiliar with the particulars of Anaconda.  

To "activate an environment" in conda is to change some environment
variables (and the prompt) to cause Python to use a different library
search path.  It also may modify the PATH variable to change where the
Python interpreter is found.  One common use is to let the user switch
between Python 2.x and 3.x interpreters.  

Because changing an environment variable in the shell process
won't affect the environment in the emacs process,  the question
becomes, What's the best way to send information to emacs?  

As for a solution, my guess is that you're going to want to write a
shell function that wraps the "activate" command, and makes the
information available to emacs.  If you run emacs as a daemon, you
could do that directly with emacslient.  If not, you could produce an
artifact, and have emacs monitor it for changes.  

--jkl


reply via email to

[Prev in Thread] Current Thread [Next in Thread]