emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Managing environments (Python venv, guix environment, etc.)


From: Stefan Monnier
Subject: Re: Managing environments (Python venv, guix environment, etc.)
Date: Fri, 22 Jul 2016 16:19:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> (require 'cl-lib)
> (require 'cl)

Please don't require both.

> (defvar environment-path-alist nil
>   "Alist of elements (PATH . ENV) for paths and special environments.")

In the GNU project (and in Emacs in particular), we use PATH to mean "a
list of directories" as in load-path, $PATH, $MANPATH.  So this should
probably be renamed to environment-directory-alist.

> (defun environment-lookup-path (path)
                                  ^^^^
Same here.

> The problem is that paths passed to find-file-name-handler, such as
> default-directory, are not necessarily canonical paths.

Yes, that's indeed a problem.  In practice it tends to work OK, tho,
because file and directory names to be constructed from each other, so
even if there are many different ways to name a particular directory,
there's typically only one that's used in a particular Emacs session.

And in any case it'd be good to fix the cases where we end up using
different names for the same dir (because they end up bumping into
similar problems).

> I don't think path resolution can be done with regular expressions,
> so this approach will never really work.

Feel free to use `advice-add' if you feel it's better.  If/when the code
gets integrated into Emacs, these kinds of problems can be resolved.

> OK, I'll wait until John expresses his thoughts. (Possibly after the
> release?)

You might also contact the authors of python's virtualenv support (and
anything else related) to get their opinions as supporting evidence for
the benefits of your suggestion.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]