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

Re: Emacs and shell variables



On  0, Stefan Bellon <sbellon@sbellon.de> wrote:
> Felix Natter wrote:
> > Stefan Bellon <sbellon@sbellon.de> writes:
> 
> > > When using Emacs to start a compilation (e.g. with C-c C-c from C++
> > > mode) you get "make -k" as default. The problem I'm experiencing
> > > is, that I need some shell variables set in the Makefile. I've set
> > > them in my ~/.bashrc and it works fine if I start Emacs from an
> > > xterm which has this variable set in its shell.
> > > 
> > > But when I start Emacs with a function key, then the ~/.bashrc
> > > obviously isn't executed, the shell variable isn't set and the make
> > > process fails.
> > > 
> > > So, how do I tell Emacs always to execute ~/.bashrc in order to get
> > > at my shell variables?
> 
> > You can put your variables both in ~/.bashrc and ~/.bash_profile.
> > Or you can use (setenv "TEST" "foo").
> 
> It looks like I didn't make my problem clear enough.
> 
> The variables *are* already in ~/.bashrc (and they're exported there).
> But Emacs only knows about them if I start Emacs from a bash. If I
> however use a function key I have defined with fvwm, then Emacs doesn't
> start with the shell as parent and therefore hasn't the variables set.
> And I'd like Emacs to have those variables set even then.

So put (setenv "variable" "value") in your .emacs

Tom
-- 
Tom Cook
Information Technology Services, The University of Adelaide

"That you're not paranoid does not mean they're not out to get you."
	- Robert Waldner

Get my GPG public key: https://pinky.its.adelaide.edu.au/~tkcook/tom.cook-at-adelaide.edu.au

Attachment: pgpXETiV__WyT.pgp
Description: PGP signature


Reply to: