R. Mattes | 14 Jun 2012 11:10
Picon

Re: autostart.sh and bashrc

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

> 
> 2012/6/13 <jimmy.wants.no.spam@...> 
>  
> On Wed, 13 Jun 2012, 10:10+0800, Ashi <ashi08104@...> 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? 
(Continue reading)

Ashi | 14 Jun 2012 15:25
Picon

Re: autostart.sh and bashrc



2012/6/14 R. Mattes <rm-UbM7tZgH5C9j4WSHiO5qAw@public.gmane.org>
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:(

>
> 2012/6/13 <jimmy.wants.no.spam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> On Wed, 13 Jun 2012, 10:10+0800, Ashi <ashi08104-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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-y8u1feBGtzxAfugRpC6u6w@public.gmane.org
> http://icculus.org/mailman/listinfo/openbox
>
>
> --
> Best wishes!
> Ashi

--
 R. Mattes -
 Hochschule fuer Musik Freiburg
 rm-WB/cTxoGmdEAQYTKkOM0U4QuADTiUCJX@public.gmane.org

_______________________________________________
openbox mailing list
openbox-y8u1feBGtzxAfugRpC6u6w@public.gmane.org
http://icculus.org/mailman/listinfo/openbox



--
Best wishes!
zw_yao

_______________________________________________
openbox mailing list
openbox@...
http://icculus.org/mailman/listinfo/openbox
R. Mattes | 14 Jun 2012 15:43
Picon

Re: autostart.sh and bashrc [OT]

On Thu, 14 Jun 2012 21:25:07 +0800, Ashi wrote 
> 2012/6/14 R. Mattes <rm@...> 
>  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@...> 
> > 
> > On Wed, 13 Jun 2012, 10:10+0800, Ashi <ashi08104@...> 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@... 
> > http://icculus.org/mailman/listinfo/openbox 
> > 
> > 
> > -- 
> > Best wishes! 
> > Ashi 
> 
> -- 
>  R. Mattes - 
>  Hochschule fuer Musik Freiburg 
>  rm@... 
>  
> 
> _______________________________________________ 
> openbox mailing list 
> openbox@... 
> http://icculus.org/mailman/listinfo/openbox 
>  
>  
> -- 
> Best wishes! 
> zw_yao

--

-- 
 R. Mattes - 
 Hochschule fuer Musik Freiburg 
 rm@...

_______________________________________________
openbox mailing list
openbox@...
http://icculus.org/mailman/listinfo/openbox

Ashi | 14 Jun 2012 15:47
Picon

Re: autostart.sh and bashrc [OT]



2012/6/14 R. Mattes <rm-UbM7tZgH5C9j4WSHiO5qAw@public.gmane.org>
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

Thanks your sugestion!
>
> >
> > 2012/6/13 <jimmy.wants.no.spam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >
> > On Wed, 13 Jun 2012, 10:10+0800, Ashi <ashi08104-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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-y8u1feBGtzxAfugRpC6u6w@public.gmane.org
> > http://icculus.org/mailman/listinfo/openbox
> >
> >
> > --
> > Best wishes!
> > Ashi
>
> --
>  R. Mattes -
>  Hochschule fuer Musik Freiburg
>  rm-WB/cTxoGmdEAQYTKkOM0U4QuADTiUCJX@public.gmane.org
>
>
> _______________________________________________
> openbox mailing list
> openbox-y8u1feBGtzxAfugRpC6u6w@public.gmane.org
> http://icculus.org/mailman/listinfo/openbox
>
>
> --
> Best wishes!
> zw_yao

--
 R. Mattes -
 Hochschule fuer Musik Freiburg
 rm-WB/cTxoGmdEAQYTKkOM0U4QuADTiUCJX@public.gmane.org

_______________________________________________
openbox mailing list
openbox-y8u1feBGtzxAfugRpC6u6w@public.gmane.org
http://icculus.org/mailman/listinfo/openbox



--
Best wishes!
ashi

_______________________________________________
openbox mailing list
openbox@...
http://icculus.org/mailman/listinfo/openbox

Gmane