all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Hook for Environment Activation?
@ 2016-11-09  0:02 Brandeis King
  2016-11-09 18:19 ` James K. Lowden
  0 siblings, 1 reply; 2+ messages in thread
From: Brandeis King @ 2016-11-09  0:02 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

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. Is this possible? If so how?

Thanks.

-Brandeis


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Hook for Environment Activation?
  2016-11-09  0:02 Hook for Environment Activation? Brandeis King
@ 2016-11-09 18:19 ` James K. Lowden
  0 siblings, 0 replies; 2+ messages in thread
From: James K. Lowden @ 2016-11-09 18:19 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-09 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-09  0:02 Hook for Environment Activation? Brandeis King
2016-11-09 18:19 ` James K. Lowden

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.