unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Windows: exec-path not working?
@ 2009-07-29  9:12 Elena
  2009-07-29 16:15 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Elena @ 2009-07-29  9:12 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I was trying to use the "M-x grep" under Windows, but it was failing
since "grep.exe" was missing. I downloaded GnuWin32's grep (it worked
under command line) and appended its directory to exec-path:

(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?

Thanks.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Windows: exec-path not working?
  2009-07-29  9:12 Windows: exec-path not working? Elena
@ 2009-07-29 16:15 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2009-07-29 16:15 UTC (permalink / raw)
  To: help-gnu-emacs

> 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.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-29 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-29  9:12 Windows: exec-path not working? Elena
2009-07-29 16:15 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).