help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Windows: exec-path not working?


From: Eli Zaretskii
Subject: Re: Windows: exec-path not working?
Date: Wed, 29 Jul 2009 19:15:21 +0300

> From: Elena <egarrulo@gmail.com>
> Date: Wed, 29 Jul 2009 02:12:59 -0700 (PDT)
> 
> (setq exec-path (append exec-path (list "C:/gnuwin32/bin")))
> 
> and checked it. Anyway, running "M-x grep" still couldn't find "grep".
> 
> Then, I set Emacs' environment PATH by means of "setenv" and "grep"
> got found.
> 
> Shouldn't be exec-path and PATH achieve the same goal under Emacs?

No.  exec-path is used by Emacs to search for programs it runs
directly.  But "M-x grep" does not run grep.exe directly; it runs the
shell passing it a command that invokes grep.  So it's the shell that
needs to find grep.exe, and it uses PATH, of course, not exec-path.

So the right thing to do when you install a new program, in order for
Emacs to find it, is _both_ to update exec-path _and_ update PATH.
This is because some Emacs features invoke programs directly, while
others do that through the shell or some other intermediary programs.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]