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: Eli Zaretskii
Subject: Re: setevn PATH vs exec-path [was Re: Flyspell error]
Date: Fri, 07 Aug 2009 12:30:24 +0300

> From: Xah Lee <xahlee@gmail.com>
> Date: Wed, 5 Aug 2009 16:51:03 -0700 (PDT)
> 
> For Windows emacs users who uses unix shell, won't there be
> exceptions?
> 
> For example, i use emacs on windows, but right now predominately uses
> unix shell cygwin
> 
> when i run “M-x shell” in emacs, i don't want my shell to touch any of
> the Windows's executables if possible. e.g. i set PATH in emacs in a
> way assuming i'm working in cygwin bash:
> 
> typical paths for unix shell:
> "/usr/local/bin"
> "/usr/bin"
> "/bin"
> "/usr/X11R6/bin"
> "/cygdrive/c/Windows/Program Files (x86)/PHP/"
> 
> some Windows paths that are i think necessary in order for cygwin to
> run.
> "/cygdrive/c/Windows/system32"
> "/cygdrive/c/Windows"
> "/cygdrive/c/Windows/System32/Wbem"
> 
> but when i'm not in shell in emacs, i do want Windows emacs to be able
> to access any normal Windows's executables, so my exec-path is like
> this:
> 
>  "C:/cygwin/bin/"
>  "C:/Program Files (x86)/Emacs/emacs/bin/"
>  "C:/Program Files (x86)/PHP/"
>  "C:/Windows/system32/"
>  "C:/Windows/"
>  "C:/Windows/System32/Wbem/"
> 
> if i just setenv PATH and just let emacs set exec-path, i think i ran
> into some problems in emacs... that could be i messed something up in
> my setenv PATH...

IMO, mixing a native Windows build of Emacs and Cygwin executables
that Emacs features need is asking for trouble.  You can, of course,
make this work, but then you'd need to tinker quite a lot with Emacs
features, read their code, and change many defaults to make them work
as intended.  PATH and exec-path are indeed two settings you will need
to put under tight control, to make things work.  But I'm sure there
are others.

I don't recommend such a mix to anyone who needs Emacs on Windows to
"just work".  If you like Cygwin, simply install the Cygwin build of
Emacs and be done.  Emacs 23.1 _does_ supported the Cygwin build, and
after many years there's again an active maintainer of the Cygwin
Emacs.  So any problems you find there will probably be fixed without
delays.

OTOH, if you need to be able to invoke native Windows programs from
Emacs, and Cygwin somehow doesn't let you to do that, use native
Windows ports exclusively.  That is what I do, and I have yet to see a
significant problem that wouldn't be resolved by installing a native
Windows port of some utility, or by fixing some bug in Emacs.  (For
example, yesterday I fixed Calc to allow graphing commands to work
with the native Windows port of Gnuplot.)

Keeping your work environment uniform and coherent will save you many
hours of grief and hair-pulling.  Unless, of course, you like to
tinker, in which case the mix you have now is the way to go.  I'm sure
you will learn a lot down the road, both about Emacs and about the
programs it invokes.





reply via email to

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