Well, the title has it all. I used to (setenv "PATH" "whatever:$PATH" t)
to be able to call things (in fact, one thing - ConTeXt, from within AUCTeX) from Emacs. Just a while ago I learned about exec-path
. Should I use it instead?
While setenv
actually sets the environment (and affect (modifies) what executed programs from this emacs will see as an environment), exec-path
tells emacs where to look for executables, but programs run from this emacs won't see their PATH
changed.
Changing the environment with setenv
does not change how the current Emacs searchs for executables, as it uses exec-path
. To achieve that and make child processes executed by this Emacs to have the $PATH
changed, you have to set both exec-path
and $PATH
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With