all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: sbaugh@catern.com
To: emacs-devel@gnu.org
Subject: Re: Managing environments (Python venv, guix environment, etc.)
Date: Mon, 18 Jul 2016 15:13:54 -0400	[thread overview]
Message-ID: <87eg6qoj2l.fsf@earth.catern.com> (raw)
In-Reply-To: jwvzipf2ewv.fsf-monnier+gmane.emacs.devel@gnu.org

Stefan Monnier <monnier@iro.umontreal.ca> writes:
> That was my assumption: your "environments" correspond to
> specific subdirectories in the file-system.

Nope, not necessarily. Python virtualenvs do have an associated
directory that contains the installed libraries for that
environment. But guix environment only updates environment variables to
point to the locations of already existing libraries, and so guix
environments don't exist in the filesystem at all. They're only a
runtime thing. (Libraries are installed on demand at fixed paths when
constructing an environment, and garbage-collected later)

However, people do mostly use environments only when working on a
specific project which exists in the filesystem, so I don't think it's
too big of a compromise to start with.

>> 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.

Oh, no, I do want to get this into Emacs. Because the use of these kind
of environments is pretty common at this point, and it would be nice if
Emacs natively understood them in a generic way. Then, yes, ELPA
packages could build on that functionality to support specific
kinds of environments. Same with the new project and xref functionality.

> 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).

If an environment is manually set for the current buffer, then use that
one for all commands run.
Otherwise, if a buffer is visiting a file in a project, check for a
manually set or automatically detected environment for that project,
then use that environment for all commands run.
Otherwise, use the global environment for all commands run.

That seems like a decent UI. But in the manually set case, it is tricky
to implement, because of the related buffers problem...

> 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.

Yes, otherwise just buffer-local exec-path and process-environment would
work okay.

> 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.

Yes, I think this is important functionality that other packages
distributed with Emacs should be able to build on. Using virtualenvs is
very common for Python, for example, and Emacs should support that.

Also, since this is a headline feature of GNU Guix, it would be nice to
support it in GNU Emacs.




  reply	other threads:[~2016-07-18 19:13 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 21:36 Managing environments (Python venv, guix environment, etc.) sbaugh
2016-07-15 16:26 ` Stefan Monnier
2016-07-17 22:41   ` sbaugh
2016-07-18 10:15     ` Andreas Röhler
2016-07-18 14:46     ` Stefan Monnier
2016-07-18 19:13       ` sbaugh [this message]
2016-07-19 13:39         ` Stefan Monnier
2016-07-24  3:35         ` Dmitry Gutov
2016-07-24  8:25           ` sbaugh
2016-07-24 23:08             ` Dmitry Gutov
2016-07-21  0:32       ` sbaugh
2016-07-22 20:19         ` Stefan Monnier
2016-07-23  7:10           ` Eli Zaretskii
2016-07-24  3:26             ` Dmitry Gutov
2016-07-24  8:25               ` sbaugh
2016-07-24 14:28                 ` Eli Zaretskii
2016-07-24 17:45                   ` sbaugh
2016-07-24 17:58                     ` Eli Zaretskii
2016-07-24 19:05                       ` Spencer Baugh
2016-07-24 19:36                         ` Eli Zaretskii
2016-07-25  4:50                           ` sbaugh
2016-07-25 17:04                             ` Eli Zaretskii
2016-07-28  0:47                               ` sbaugh
2016-07-24 23:04                 ` Dmitry Gutov
2016-07-25  2:37                   ` Eli Zaretskii
2016-07-25  5:01                     ` sbaugh
2016-07-25 17:06                       ` Eli Zaretskii
2016-07-25  7:07                   ` Michael Albinus
2016-07-25 12:49                     ` Dmitry Gutov
2016-07-25 13:03                       ` Michael Albinus
2016-07-25 13:06                         ` Dmitry Gutov
2016-07-25 13:41                         ` Stefan Monnier
2016-07-28  0:02                         ` sbaugh
2016-07-28  9:34                           ` Michael Albinus
2016-07-28 14:42                           ` Eli Zaretskii
2016-07-29 17:59                             ` sbaugh
2016-07-29 18:59                               ` Eli Zaretskii
2016-07-29 19:20                                 ` Stefan Monnier
2016-07-30  6:57                                   ` Eli Zaretskii
2016-07-30 14:42                                     ` Stefan Monnier
2016-07-30 15:56                                       ` Eli Zaretskii
2016-07-29 20:57                                 ` sbaugh
2016-07-30  7:34                                   ` Eli Zaretskii
2016-07-30 13:30                                     ` sbaugh
2016-07-30 16:17                                       ` Eli Zaretskii
2016-07-30 11:24                                   ` Michael Albinus
2016-07-29 18:42                           ` Stefan Monnier
2016-07-29 19:03                             ` Eli Zaretskii
2016-07-26  2:36                   ` Stefan Monnier
2016-07-24 14:24               ` Eli Zaretskii
2016-07-25  0:05                 ` Dmitry Gutov
2016-07-25 17:00                   ` Eli Zaretskii
2016-07-26  2:08                     ` Dmitry Gutov
2016-07-26  3:06                       ` Stefan Monnier
2016-07-26 10:45                         ` Michael Albinus
2016-07-26 12:46                           ` Stefan Monnier
2016-07-26 14:49                       ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2016-07-28 10:01 Spencer Baugh
     [not found] <87shuuvzz6.fsf@totally-fudged-out-message-id>
2016-07-28 10:08 ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eg6qoj2l.fsf@earth.catern.com \
    --to=sbaugh@catern.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.