Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly is the difference between PATH (as set by setenv) and exec-path in GNU Emacs?

Tags:

emacs

elisp

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?

like image 576
mbork Avatar asked Mar 02 '13 01:03

mbork


1 Answers

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.

like image 57
Diego Sevilla Avatar answered Oct 16 '22 14:10

Diego Sevilla