purcell / envrc

Emacs support for direnv which operates buffer-locally
378 stars 35 forks source link

Make "direnv" location customizable #46

Closed sellout closed 2 years ago

sellout commented 2 years ago

From

(defun envrc--call-process-with-global-env (&rest args)
  "Like `call-process', but always use the global process environment.
In particular, we ensure the default variable `exec-path' and
`process-environment' are used.  This ensures the
globally-accessible \"direnv\" binary is consistently available.
ARGS is as for `call-process'."
  ...)

the lack of this feature seems intentional, but I can’t quite make out why.

I configure emacs as much as possible to reference binaries directly in the Nix store, so they’re not generally in either my $PATH or exec-path. However, envrc forces me to have direnv in my exec-path.

So, I’d like to be able to change it or at least understand why that’s a bad idea (and then maybe still change it).

purcell commented 2 years ago

Hmm, I think this was about protecting directory-local environments from obliterating direnv from the path. I think it would be fine to have a configurable path for direnv, but I imagine it would be in addition to the protective measure above.

sellout commented 2 years ago

Cool. I’ll try to submit a PR for it soon. Thanks.