Jimmy, Thanks your advice. However, the exactly emacs&#39;s problem is: I try to compile the project in emacs, it calls make to do the work. And my makefile needs a call to pkg-config to get the libs and cflags to complete its work, and pkg-config need the specified environment variable of PKG_CONFIG_PATH, which is specified in bashrc. And now after move the environment variable setting to .bash_profile, emacs compile command works. Thanks again!<br>

<br><div class="gmail_quote">2012/6/13  <span dir="ltr">&lt;<a href="mailto:jimmy.wants.no.spam@gmail.com" target="_blank">jimmy.wants.no.spam@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>On Wed, 13 Jun 2012, 10:10+0800, Ashi &lt;<a href="mailto:ashi08104@gmail.com" target="_blank">ashi08104@gmail.com</a>&gt; wrote:<br>
&gt; I add the emacs daemon in the autostart.sh to speed up emacs. However, I<br>
&gt; found the environment variables setted in my bashrc is still not setted in<br>
&gt; the emacs(emacs would get all current environment variables when it<br>
&gt; started). So I guess add the needed environment variables to autostart.sh<br>
&gt; would solve this problem(I&#39;ve tested, it works). But this solution is a<br>
&gt; little ugly, I want all setting are kept in one place(such as bashrc). Is<br>
&gt; there anyway to get this?<br>
<br>
</div>As a general principle, environment variables should go in ~/.profile or<br>
a similar file, while .bashrc is for bash-specific non-environment<br>
related things like setting aliases, prompts, shell options, etc.<br>
<br>
Move your environment variables (i.e. the ones you have to export) to<br>
.profile, keeping the syntax portable as more shells than just bash read<br>
it, and see if that works.<br>
<br>
Emacs-specific settings should go in an emacs-specific configuration<br>
file and not in bashrc, of course.<br>
_______________________________________________<br>
openbox mailing list<br>
<a href="mailto:openbox@icculus.org" target="_blank">openbox@icculus.org</a><br>
<a href="http://icculus.org/mailman/listinfo/openbox" target="_blank">http://icculus.org/mailman/listinfo/openbox</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Best wishes!<br>Ashi<br><br>