Re: Emacs and shell variables
Stefan Bellon <sbellon@sbellon.de> writes:
> Hi!
>
> 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's difficult to do this in elisp because `shell-command' starts a
sub-shell (and if you do "export TEST=foo" in a subshell it won't
affect the parent process)
If you still qwant to know how to tweak Emacs, try to post to
news://gnu.emacs.help.
--
Felix Natter
--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: