Subject: bug#1541 closed by Glenn Morris <[email-masked]> (Re: bug#1541: 23.0.60; Emacs don't see $PATH)

From: [email-masked] (Emacs bug Tracking System)

This is an automatic notification regarding your bug report
which was filed against the emacs package:

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

It has been closed by Glenn Morris <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Glenn Morris <[email-masked]> by
replying to this email.

-- 
1541: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1541
Emacs Bug Tracking System
Contact [email-masked] with problems
>From [email-masked] Thu Dec 11 23:34:21 2008
From: Glenn Morris <[email-masked]>
To: [email-masked]
Subject: Re: bug#1541: 23.0.60; Emacs don't see $PATH
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.)

>From [email-masked] Thu Dec 11 14:55:39 2008
From: Dmitry Galinsky <[email-masked]>
To: [email-masked]
Subject: 23.0.60; Emacs don't see $PATH
Date: Fri, 12 Dec 2008 01:54:51 +0300

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")

In GNU Emacs 23.0.60.1 (i386-apple-darwin9.5.0, NS apple-appkit-949.35)
  of 2008-12-10 on neutron.local
Windowing system distributor `Apple', version  
97.112.112.108.101.45.97.112.112.107.105.116.45.57.52.57.46.51.53
configured using `configure  '--with-ns''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: nil
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: ru_RU.UTF8
   value of $XMODIFIERS: nil
   locale-coding-system: nil
   default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
   diff-auto-refine-mode: t
   shell-dirtrack-mode: t
   yas/minor-mode: t
   recentf-mode: t
   show-paren-mode: t
   global-auto-revert-mode: t
   delete-selection-mode: t
   pc-selection-mode: t
   tooltip-mode: t
   ns-extended-platform-support-mode: t
   mouse-wheel-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   global-auto-composition-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   column-number-mode: t
   line-number-mode: t
   transient-mark-mode: t
   hs-minor-mode: t

Recent input:
<up> <up> <up> <up> <up> <up> <up> <up> <up> <down>
<down> <down> <down> <down> <down> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <menu-bar> <help-menu> <s
end-emacs-bug-report>

Recent messages:
Mark set
Entering debugger...
git version 1.6.0.5
Mark set
Wrote /Users/dima/.emacs.d/rails-reloaded/rails-resources.el
Making completion list...
line-move-visual: End of buffer
Open /Users/dima/.emacs.d/rails-reloaded/rails-resources.el
Quit [2 times]
Open /Users/dima/.emacs.d/rails-reloaded/rails-resources.el

--
Best regards,
Dmitry Galinsky
http://dima-exe.ru