From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Managing environments (Python venv, guix environment, etc.) Date: Mon, 18 Jul 2016 10:46:28 -0400 Message-ID: References: <87y453sy0n.fsf@earth.catern.com> <87r3arripr.fsf@earth.catern.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1468853094 7111 80.91.229.3 (18 Jul 2016 14:44:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2016 14:44:54 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 18 16:44:44 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bP9mg-0001PE-Dz for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2016 16:44:38 +0200 Original-Received: from localhost ([::1]:47991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP9mf-0003OU-Sp for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2016 10:44:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP9mZ-0003Nm-Dr for emacs-devel@gnu.org; Mon, 18 Jul 2016 10:44:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bP9mU-0001av-6R for emacs-devel@gnu.org; Mon, 18 Jul 2016 10:44:30 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:36733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP9mT-0001aa-VN for emacs-devel@gnu.org; Mon, 18 Jul 2016 10:44:26 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bP9mP-0001Ck-O9 for emacs-devel@gnu.org; Mon, 18 Jul 2016 16:44:21 +0200 Original-Received: from 69-165-156-121.dsl.teksavvy.com ([69.165.156.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2016 16:44:21 +0200 Original-Received: from monnier by 69-165-156-121.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2016 16:44:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 44 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 69-165-156-121.dsl.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:eRItarTiTQfyLzPvmlIbcOQCgeo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:205802 Archived-At: > Tying environments to filenames in this way makes sense when an > environment corresponds to a project which exists in the filesystem. That was my assumption: your "environments" correspond to specific subdirectories in the file-system. > Does this approach (putting project root directories into > file-name-handler-alist) sound like something that could be accepted > into core Emacs? If so I'll get started. Hard to tell. Even the question is unclear to me. The approach I suggest assumes you don't need/want to make changes to what I consider "core" and instead use existing hooks (in this case file-name-handler-alist). So it could be distributed via GNU ELPA, for example. > Also, in the future, it would be nice to have the ability to just run > (something like) "M-x environment-switch" to switch the current buffer > to a new environment, and have an invocation of e.g. "M-x compile" just > work. That seems to assume that an environment could be bound to a buffer rather than a subdirectory, IOW it wouldn't be chained to a subdirectory. Such environments seem to introduce further questions about how to determine which env to use for which buffer (IOW what UI to expose to the user). > Does anyone have any thoughts about how to eventually support that? You could set file-name-handler-alist buffer-locally, maybe? Still, the main issue is what to do about things that happen in other buffers but which the user would consider as related. >> And of course, yet another is to advice-add on call-process and >> start-process. > Yeah, but I'd like to be able to get this into Emacs (hopefully by 26). You mean you want it distributed with Emacs? Most new packages nowadays end up in GNU ELPA rather than in Emacs, unless they offer functionality needed by other packages that are distributed with Emacs. Stefan