From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "James K. Lowden" Newsgroups: gmane.emacs.help Subject: Re: Hook for Environment Activation? Date: Wed, 9 Nov 2016 13:19:50 -0500 Organization: http://www.NewsDemon.com Message-ID: <20161109131950.1ffc025a7b8a9998cb5251de@speakeasy.net> References: <1db1e9d3-f035-4630-a26b-1a5748021f4f@googlegroups.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1478716486 14171 195.159.176.226 (9 Nov 2016 18:34:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 9 Nov 2016 18:34:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 09 19:34:42 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4XhJ-0007m2-Pg for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Nov 2016 19:34:09 +0100 Original-Received: from localhost ([::1]:41748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4XhM-0002cw-Nd for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Nov 2016 13:34:12 -0500 X-Received: by 10.36.117.12 with SMTP id y12mr1069773itc.11.1478715592263; Wed, 09 Nov 2016 10:19:52 -0800 (PST) Original-Path: usenet.stanford.edu!q124no112364itd.0!news-out.google.com!m27ni23qtf.1!nntp.google.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!post02.iad.highwinds-media.com!fx14.iad.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Newsreader: Sylpheed 3.4.3 (GTK+ 2.24.28; x86_64--netbsd) Original-Lines: 29 Original-X-Complaints-To: abuse@newsdemon.com Original-NNTP-Posting-Date: Wed, 09 Nov 2016 18:19:51 UTC X-Received-Bytes: 2052 X-Received-Body-CRC: 236048273 Original-Xref: usenet.stanford.edu gnu.emacs.help:219007 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111699 Archived-At: On Tue, 8 Nov 2016 16:02:03 -0800 (PST) Brandeis King 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