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

From: Eli Zaretskii <[email-masked]>
Date: Fri, 12 Dec 2008 07:15:31 -0500

> From: Dmitry Galinsky <[email-masked]>
> Date: Fri, 12 Dec 2008 01:54:51 +0300
> Cc: 
> Reply-To: Dmitry Galinsky <[email-masked]>, [email-masked]
> 
> Emacs don't see $PATH environment variable.
> 
> Step to reproduce bug:
> 
> (setenv "PATH" (concat "/opt/local/bin:" (getenv "PATH")))
> (getenv "PATH") ;; => "/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
> (shell-command-to-string "which git") ;; > /opt/local/bin/git
> (git-status) ;; produced the error
> 
> backtrace:
>    Debugger entered--Lisp error: (file-error "Searching for program"  
> "No such file or directory" "git")
>    call-process("git" nil t nil "rev-parse" "--show-cdup")

This is not a bug: setenv changes the value of PATH passed to the
child processes, but not the value Emacs itself uses to search for
executable programs.  In your case, had Emacs found and invoked `git',
it would have passed `git' the value of PATH that included
"/opt/local/bin".