Subject: Re: bug#1541: 23.0.60; Emacs don't see $PATH

From: Glenn Morris <[email-masked]>
Date: Fri, 12 Dec 2008 02:33:38 -0500

Dmitry Galinsky wrote:

> (setenv "PATH" (concat "/opt/local/bin:" (getenv "PATH")))

> (shell-command-to-string "which git") ;; > /opt/local/bin/git

> "No such file or directory" "git")
>   call-process("git" nil t nil "rev-parse" "--show-cdup")

It doesn't work like that. call-process uses the Lisp variable
exec-path, which is set at startup based on the value of $PATH.
So you should be adding /opt/local/bin to exec-path, or to PATH before
you start Emacs. Changing PATH after Emacs has started will not affect
call-process and similar things.

(There may be a separate issue with --with-ns and environment, bug#1333.)