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

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

RE: setevn PATH vs exec-path [was Re: Flyspell error]


From: Drew Adams
Subject: RE: setevn PATH vs exec-path [was Re: Flyspell error]
Date: Wed, 5 Aug 2009 10:25:17 -0700

> Actually, my advice is to have them both identical (well, actually,
> equivalent, not identical, because one is a list while the other is a
> string).  That's because exec-path is used when Emacs invokes programs
> directly (e.g., via `call-process') while PATH is used indirectly when
> Emacs invokes programs via the shell, like in "M-x compile" 
> or "M-x grep".
> In the latter case, the shell will look for programs along PATH.
> If your values are not equivalent, some Emacs commands that invoke
> subsidiary programs will mysteriously fail, and unless you know very
> well which Emacs command uses the shell and which does not, you will
> have hard time figuring out how to set them correctly.
> 
> Of course, if PATH is modified before Emacs is started, then exec-path
> will be automatically equivalent to PATH, because it's computed from
> PATH's value.

It might be good to add that advice to the Emacs manual. The last sentence,
about the default value of `exec-path', is there (in nodes `Single Shell' and
`Interactive Shell'), but not the rest.

There is also env var EMACSPATH, which is used to initialize `exec-path' (see
node `General Variables'). Note that the same thing is said, in the same node,
about env var `PATH'. Nothing is said about which of them takes precedence, if
both env vars are defined. And while PATH is mentioned in nodes `Single Shell'
and `Interactive Shell' as the start-time source of `exec-path', EMACSPATH is
not mentioned beyond the one-liner in node `General Variables'.





reply via email to

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