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: Sat, 30 Jul 2016 09:30:59 -0400	[thread overview]
Message-ID: <8760rnckx8.fsf@earth.catern.com> (raw)
In-Reply-To: 83wpk3poj9.fsf@gnu.org

Eli Zaretskii <eliz@gnu.org> writes:
> And having read all that, I still don't see why we would like to use
> file-name handlers for supporting these features.  My suggestion to
> embed such support directly in the affected primitives, like
> process-file, call-process, etc., still stands.  Would you please
> consider this possibility, and if you think it's inappropriate,
> explain why you think so?

I think I missed the suggestion when you made it earlier (or don't
recognize it as the same suggestion now) and I'm not sure I understand
it in this condensed form. Could you elaborate?

In particular I'm missing how directly adding environment support in
process-file etc. will handle the issue of, e.g., a user invoking M-x
compile, where we need to communicate the environment to use between
buffers.

> If you want an environment to be able to change its locale, then we
> must also pay attention to the following subtlety: the value of
> process-environment is stored by Emacs in its original undecoded form,
> i.e. in the encoding used by the "pre-existing environment"s codeset.
> Thus, supporting locale changes seem to require a separate variable
> that is used in preference to process-environment, and whose value is
> encoded according to the customized locale.

Hmm, it's indeed tricky that as locale changes, the encoding of all
other environment variables also needs to change (if I understand you
correctly). It was probably a bad example though because I doubt that
any environment-creating tools will set a different locale. If there are
some that do, it might be useful to look at what they do to handle
this...

> Would having a single user variable for controlling the above be a
> sufficiently nice UI?  If not, why not?

A single user variable controlling what environment we are in? Meaning
that Emacs is only ever in exactly one environment? That is not
adequate, it makes it difficult to work on different projects in the
same Emacs. And anyway a single environment approach can already be done
easily enough by writing a command to just swap between different values
for process-environment, exec-path, and so on.

>> However, TRAMP also needs to be able to support running processes on
>> remote hosts. And there its mechanism is rather unnatural - why
>> should we use a filename to identify the remote host on which we want to
>> run a process?
>
> In the context of running processes on remote hosts, this is actually
> very natural.  It allows Lisp applications to be stateless in this
> regard.
>
> By contrast, environments support cannot be stateless, because by the
> very definition, when a command is executed in a certain environment,
> then _all_ of the files and environment variables should be as the
> environment defines.

In what way does this allow statelessness, that it doesn't also allow
for environments?

This mechanism allows a Lisp application to ignore whether there is
currently a connection to a remote host, when trying to run a process on
a remote host, since the connection will be created by TRAMP
automatically - is that what you mean by stateless?

Environment usage can be just as stateless. The custom environment
identifier embedded into the file name can and should be enough
information to locate the configuration for the environment, load it
into Emacs, and start using it. Thus a Lisp application trying to run a
process in an environment can ignore whether the environment is
currently in use by Emacs.




  reply	other threads:[~2016-07-30 13:30 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
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 [this message]
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=8760rnckx8.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.