From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Newsgroups: gmane.emacs.devel Subject: Re: Managing environments (Python venv, guix environment, etc.) Date: Mon, 18 Jul 2016 12:15:15 +0200 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; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1468836668 5046 80.91.229.3 (18 Jul 2016 10:11:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2016 10:11:08 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 18 12:10:59 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 1bP5Vr-0001Xq-9d for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2016 12:10:59 +0200 Original-Received: from localhost ([::1]:45655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP5Vq-0005GM-9o for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2016 06:10:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP5V3-0005Cl-9O for emacs-devel@gnu.org; Mon, 18 Jul 2016 06:10:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bP5Uz-0006pH-3p for emacs-devel@gnu.org; Mon, 18 Jul 2016 06:10:08 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.130]:64468) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP5Uy-0006p0-PB for emacs-devel@gnu.org; Mon, 18 Jul 2016 06:10:05 -0400 Original-Received: from [192.168.178.35] ([77.12.45.54]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0LpRtB-1atLi82aP7-00fELf for ; Mon, 18 Jul 2016 12:10:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.1.0 In-Reply-To: <87r3arripr.fsf@earth.catern.com> X-Provags-ID: V03:K0:JNFPIwQ8EJpmWFrg/QKpAr5M+w5nJihUvEsOJZ7QYfEtogZ7lbm 45KyM9SKVXBMuQuBw+/UFOgiuUTK7ln8jDg+1oN2RzaTpbU5PY4NmvPVKyh88RWbqIiTNW8 Io+BLbixo22swVFBy6lb27r+pEia7hiaSnhubLl7A8WtWyKVMD7R6aSU/61dlwULjXuXqoN Hpgtb7f1i1GAZKJ6EVZxg== X-UI-Out-Filterresults: notjunk:1;V01:K0:rW1mhjVhGUA=:Bes1/8qCZX/AabVhHKkOJ6 ZugIuI2UpHtESqB7bMrhNLwieatsLVNGtMtcfhLtxcQjw/5PKLk1SFuBVtIlGelZn/VHOeARV lqn9JuZeZ0hvaOgtLSigDMNS0hzbTDmS33J4ugMTq9HHYo5Q/g+mWjpr8LZ6qZgVgVnbJ7B/i JOOljmBOhFQ4KcaQXfgjdS+4Wz0QkHFClwb1/wKLfOlsyX0foCI/mS0ng/AOQMDPT0b9bdvEG D4vLyi5xVXUuVCvV+VC3Jxb8S4plZRyIsCpFBKO17U6t+FcbCIhAseOzKuMEz+saOWa1BfUow GWfQ1RIZkQtTtmLmz9KBH7B0EINQ+HsV2AFKEVirmuKmn+dv7JusuFuY0wr9jB3gaFFT01WK5 t95fHrrU4RArvHGrQFzr1W1zPtFGxoH85jBotYGVRXqsYMemCbhSjDGjbWI3WQBwDcQv+NugF 04QQ/aIovPeMUz4VdSfyZfRAtrjnE3L3wTS1OUneKY6nCuT9PWmkDec/pGTtmxPXbzRsq4TYX GIwIGT+nd8J45et4VXHDhilR3F3PmmuVxpAj+qT5gX/nIpdkPJZ6ERgOa8uosoAD/i9vbY3TO scIjf8KebTraPl0F4dLw9yC298ZpHLPpQnYnbZ8ldE4icot/DeIUSkevblKu4DLTTflBZM16+ Y405BRQlVDmVCoZsc+v3xSY0MSeUFFwOOuDHISNkYWUVKe1jaqOSzpHMt0DMfLkQ+NLtSIpwg juyNOJuzKNyMgbTF X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.130 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:205792 Archived-At: On 18.07.2016 00:41, sbaugh@catern.com wrote: >> If M-x compile obeys dir-locals that could work, yes. > I checked (by creating a .dir-locals.el containing a setting for the > exec-path variable in compliation-mode) and it doesn't seem to read > exec-path from dir-locals. > >> Another option is to use process-file's file-name-handler-alist. > So we'd maintain a mapping from visited filenames to the environment > that that filename is in, and make sure that visited filenames in a > nonstandard environment are present in file-name-handler-alist. > > Tying environments to filenames in this way makes sense when an > environment corresponds to a project which exists in the filesystem. In > that case we can just put the project root directory into > file-name-handler-alist, and instantly everything in the project works > in the new environment. > > And for running one-off commands (to send my mail, or something else not > associated with any project) I've always been able to just wrap the > command with a let-binding of exec-path and process-environment. (The > environment package could provide a new macro to do that) > > So then there would be two ways to enter a different environment for Emacs: > One for projects and based on file-name-handler-alist, and one for single > commands and based on let-binding. I think that would be enough to start. > > 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. Hi, not being an Emacs core-developer, you may safely ignore my answer. The problem here IMHO is, that "environment" and resp. also "project" might mean quite different things according to language and concrete0 task. Certainly there are groups of apps which demand the similar, others will be not comparable. So far extending the related packages --projectile or whatever-- seems the way to go. DRY by separating basic stuff should always be an option. Thanks for your care, Andreas