[openbox] autostart.sh and bashrc [OT]

R. Mattes rm at mh-freiburg.de
Thu Jun 14 09:43:12 EDT 2012


On Thu, 14 Jun 2012 21:25:07 +0800, Ashi wrote 
> 2012/6/14 R. Mattes <rm at mh-freiburg.de> 
>  On Thu, 14 Jun 2012 10:16:31 +0800, Ashi wrote 
> 
> > Jimmy, Thanks your advice. However, the exactly emacs'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! 
> 
> But wouldn't it be easier (and more flexible) to just have emacs invoke 
> 'make' with the right environment? The first time you call 'compile' 
> from emacs it should prompt you for the command to compile (and probably 
> offer 'make -k') - you can easily change that to 'PKG_CONFIG_PATH=/foo/bar 
> make -k'. 
> With a prefix command 'compile' will always prompt for the command to use. 
> 
>  HTH Ralf Mattes 
>  
> A little out topic here, when I call comple in Emacs, it prompts 'make -k'
every time, then I need type PKG_CONFIG_PATH=/foo/bar every time:( 

Read up on 'compilation-read-command'  

 HTH RalfD

> 
> > 
> > 2012/6/13 <jimmy.wants.no.spam at gmail.com> 
> > 
> > On Wed, 13 Jun 2012, 10:10+0800, Ashi <ashi08104 at gmail.com> wrote: 
> > > I add the emacs daemon in the autostart.sh to speed up emacs. However, I 
> > > found the environment variables setted in my bashrc is still not setted in 
> > > the emacs(emacs would get all current environment variables when it 
> > > started). So I guess add the needed environment variables to autostart.sh 
> > > would solve this problem(I've tested, it works). But this solution is a 
> > > little ugly, I want all setting are kept in one place(such as bashrc). Is 
> > > there anyway to get this? 
> > 
> > As a general principle, environment variables should go in ~/.profile or 
> > a similar file, while .bashrc is for bash-specific non-environment 
> > related things like setting aliases, prompts, shell options, etc. 
> > 
> > Move your environment variables (i.e. the ones you have to export) to 
> > .profile, keeping the syntax portable as more shells than just bash read 
> > it, and see if that works. 
> > 
> > Emacs-specific settings should go in an emacs-specific configuration 
> > file and not in bashrc, of course. 
> > _______________________________________________ 
> > openbox mailing list 
> > openbox at icculus.org 
> > http://icculus.org/mailman/listinfo/openbox 
> > 
> > 
> > -- 
> > Best wishes! 
> > Ashi 
> 
> -- 
>  R. Mattes - 
>  Hochschule fuer Musik Freiburg 
>  rm at inm.mh-freiburg.de 
>  
> 
> _______________________________________________ 
> openbox mailing list 
> openbox at icculus.org 
> http://icculus.org/mailman/listinfo/openbox 
>  
>  
> -- 
> Best wishes! 
> zw_yao

-- 
 R. Mattes - 
 Hochschule fuer Musik Freiburg 
 rm at inm.mh-freiburg.de



More information about the openbox mailing list