Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!bbn!jr@bbn.com From: jr@bbn.com (John Robinson) Newsgroups: comp.emacs Subject: Re: exec-path and process-environment in gnu-18.53 Message-ID: <39147@bbn.COM> Date: 26 Apr 89 16:25:32 GMT References: Sender: news@bbn.COM Reply-To: jr@bbn.com (John Robinson) Organization: BBN Systems and Technologies Corporation, Cambridge MA Lines: 53 In-reply-to: mlm@doorknob.UUCP In article , mlm@doorknob writes: >Elisp Gurus, >I am using gnuemacs distribution 18.53, and i need to change the PATH >used when emacs spawns subprocesses. Generally, there are two answers. 1. Compile emacs with the MAINTAIN_ENVIRONMENT variable set. This will bring in a function (setenv) like (getenv) for you to use from elisp. 2. For interactive shells, emacs looks for files ~/.emacs_sh or ~/.emacs_csh and feeds them to the shell when it is started. 3. You may be able to manipulate the command that is executed to be, e.g., (depending on your shell-file-name variable) "PATH=extra/dir/:$PATH make -k" or "setenv PATH (extra/dir/ $PATH); make -k" This you can do once when you run M-X compile; it will remember the last command in compile-command it issued and default to it next time. You can set it from your .emacs. You may be able to imbed a conditional so that it checks pwd and reacts accordingly. Did I say two ways? Silly me... > Specifically, i want the compile >library to use one of two paths, depending on which source directory i >am compiling in. Isn't it better to do this in your Makefile? Then you can compile correctly when you are outside emacs (oh, I get it :-) > I have changed both exec-path and >process-environment to no avail. Hmmm, that should have worked, according to the documentation... But, these could be buffer-local variables, which might throw you off the scent. > Whenever i start up a process, it >always inherits the environment of the original emacs. Is there no >way to change the environment of an already-executing emacs? See above. -- /jr jr@bbn.com or bbn!jr C'mon big money!