Eli Zaretskii <e...@gnu.org> writes:

> In general, there's no way I know of to change PATH inside a running
> program (in this case Emacs), except by restarting it.  

You don't need to change the PATH of the Emacs process. You need to
change the PATH that emacs passes to processes it spawns. That's what
`exec-path' is for:


  (setq exec-path
        (list
         (expand-file-name "~/bin")
         (concat "/Apps/GNAT-" (getenv "GNAT_VERSION") "/bin")
         (concat (getenv "ANDROID_HOME") "/tools")
         (concat (getenv "ANDROID_HOME") "/platform-tools")
         "c:/Program Files (x86)/Java/jdk1.7.0_05/bin"
         (concat (getenv "ANT_HOME") "/bin")
         (or
          (getenv "EMACS_BIN") ;; emacs 23.2
          (getenv "EMACSPATH") ;; ?
          (concat (getenv "emacs_dir") "/bin") ;; emacs 24.3
          )
         "c:/Projects/monotone/monotone-build_mingw" ; working version
;         "c:/MinGW/bin" ; dlls for new mtn version
;         "c:/Apps/monotone-1.0" ; current version; dlls
         "c:/Apps/monotone-1.0.90" ; testing version; newer dlls
         "c:/Apps/Inno_Setup_5.4.3"
         "c:/bin"
         "c:/WINDOWS/system32"))
  (setenv "PATH" (mapconcat 'identity  exec-path  path-separator))

I do this all the time in a running emacs, to change what I'm working
on. For example, which version of a compiler gets run by `compile'.

-- 
-- Stephe

Reply via email to