* exec-path not changed in autostart
@ 2014-12-19 21:09 Xin Jin
2014-12-19 21:46 ` Eli Zaretskii
[not found] ` <mailman.16507.1419025590.1147.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 7+ messages in thread
From: Xin Jin @ 2014-12-19 21:09 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
I use the following code to add the paths from the shell environment to exec-path:
(setq exec-path
(append
(split-string-and-unquote (getenv "PATH") ":")
exec-path))
However, it does not work when "emacs24 --daemon" runs as a system autostart script. The interesting thing is that if I run "emacs24 --daemon" manually, the above code does work and the paths are successfully added.
I am really confused. Can anyone see why this happens?
I am running openbox on debian wheezy.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: exec-path not changed in autostart
2014-12-19 21:09 exec-path not changed in autostart Xin Jin
@ 2014-12-19 21:46 ` Eli Zaretskii
[not found] ` <mailman.16507.1419025590.1147.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2014-12-19 21:46 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Fri, 19 Dec 2014 13:09:19 -0800 (PST)
> From: Xin Jin <zariskij@gmail.com>
> Injection-Date: Fri, 19 Dec 2014 21:09:20 +0000
>
> I use the following code to add the paths from the shell environment to exec-path:
>
> (setq exec-path
> (append
> (split-string-and-unquote (getenv "PATH") ":")
> exec-path))
Why do you need that? exec-path already includes the directories from
$PATH, so the above sounds redundant.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: exec-path not changed in autostart
[not found] ` <mailman.16507.1419025590.1147.help-gnu-emacs@gnu.org>
@ 2014-12-19 21:54 ` Xin Jin
2014-12-19 21:58 ` Xin Jin
0 siblings, 1 reply; 7+ messages in thread
From: Xin Jin @ 2014-12-19 21:54 UTC (permalink / raw)
To: help-gnu-emacs
No, it doesn't. I added some paths to $PATH in .bashrc, and clearly they do not show up in exec-path by default.
On Friday, December 19, 2014 1:46:31 PM UTC-8, Eli Zaretskii wrote:
> > Date: Fri, 19 Dec 2014 13:09:19 -0800 (PST)
> > From: Xin Jin <zariskij@gmail.com>
> > Injection-Date: Fri, 19 Dec 2014 21:09:20 +0000
> >
> > I use the following code to add the paths from the shell environment to exec-path:
> >
> > (setq exec-path
> > (append
> > (split-string-and-unquote (getenv "PATH") ":")
> > exec-path))
>
> Why do you need that? exec-path already includes the directories from
> $PATH, so the above sounds redundant.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: exec-path not changed in autostart
2014-12-19 21:54 ` Xin Jin
@ 2014-12-19 21:58 ` Xin Jin
2014-12-19 22:01 ` Xin Jin
0 siblings, 1 reply; 7+ messages in thread
From: Xin Jin @ 2014-12-19 21:58 UTC (permalink / raw)
To: help-gnu-emacs
On Friday, December 19, 2014 1:54:34 PM UTC-8, Xin Jin wrote:
> No, it doesn't. I added some paths to $PATH in .bashrc, and clearly they do not show up in exec-path by default.
>
> On Friday, December 19, 2014 1:46:31 PM UTC-8, Eli Zaretskii wrote:
> > > Date: Fri, 19 Dec 2014 13:09:19 -0800 (PST)
> > > From: Xin Jin <zariskij@gmail.com>
> > > Injection-Date: Fri, 19 Dec 2014 21:09:20 +0000
> > >
> > > I use the following code to add the paths from the shell environment to exec-path:
> > >
> > > (setq exec-path
> > > (append
> > > (split-string-and-unquote (getenv "PATH") ":")
> > > exec-path))
> >
> > Why do you need that? exec-path already includes the directories from
> > $PATH, so the above sounds redundant.
Hmm, so is that the .bashrc is processed too slowly so that $PATH hasn't updated?
But even if I add (sleep 10s && emacs24 --daemon), it still doesn't work. Maybe I should try longer.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: exec-path not changed in autostart
2014-12-19 21:58 ` Xin Jin
@ 2014-12-19 22:01 ` Xin Jin
2014-12-19 22:13 ` Óscar Fuentes
[not found] ` <mailman.16510.1419027237.1147.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 7+ messages in thread
From: Xin Jin @ 2014-12-19 22:01 UTC (permalink / raw)
To: help-gnu-emacs
On Friday, December 19, 2014 1:58:45 PM UTC-8, Xin Jin wrote:
> On Friday, December 19, 2014 1:54:34 PM UTC-8, Xin Jin wrote:
> > No, it doesn't. I added some paths to $PATH in .bashrc, and clearly they do not show up in exec-path by default.
> >
> > On Friday, December 19, 2014 1:46:31 PM UTC-8, Eli Zaretskii wrote:
> > > > Date: Fri, 19 Dec 2014 13:09:19 -0800 (PST)
> > > > From: Xin Jin <zariskij@gmail.com>
> > > > Injection-Date: Fri, 19 Dec 2014 21:09:20 +0000
> > > >
> > > > I use the following code to add the paths from the shell environment to exec-path:
> > > >
> > > > (setq exec-path
> > > > (append
> > > > (split-string-and-unquote (getenv "PATH") ":")
> > > > exec-path))
> > >
> > > Why do you need that? exec-path already includes the directories from
> > > $PATH, so the above sounds redundant.
>
> Hmm, so is that the .bashrc is processed too slowly so that $PATH hasn't updated?
>
> But even if I add (sleep 10s && emacs24 --daemon), it still doesn't work. Maybe I should try longer.
Even sleep 20s does not work.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: exec-path not changed in autostart
2014-12-19 22:01 ` Xin Jin
@ 2014-12-19 22:13 ` Óscar Fuentes
[not found] ` <mailman.16510.1419027237.1147.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 7+ messages in thread
From: Óscar Fuentes @ 2014-12-19 22:13 UTC (permalink / raw)
To: help-gnu-emacs
Xin Jin <zariskij@gmail.com> writes:
> On Friday, December 19, 2014 1:58:45 PM UTC-8, Xin Jin wrote:
>> On Friday, December 19, 2014 1:54:34 PM UTC-8, Xin Jin wrote:
>> > No, it doesn't. I added some paths to $PATH in .bashrc, and clearly they do not show up in exec-path by default.
>> >
>> > On Friday, December 19, 2014 1:46:31 PM UTC-8, Eli Zaretskii wrote:
>> > > > Date: Fri, 19 Dec 2014 13:09:19 -0800 (PST)
>> > > > From: Xin Jin <zariskij@gmail.com>
>> > > > Injection-Date: Fri, 19 Dec 2014 21:09:20 +0000
>> > > >
>> > > > I use the following code to add the paths from the shell environment to exec-path:
>> > > >
>> > > > (setq exec-path
>> > > > (append
>> > > > (split-string-and-unquote (getenv "PATH") ":")
>> > > > exec-path))
>> > >
>> > > Why do you need that? exec-path already includes the directories from
>> > > $PATH, so the above sounds redundant.
>>
>> Hmm, so is that the .bashrc is processed too slowly so that $PATH hasn't updated?
>>
>> But even if I add (sleep 10s && emacs24 --daemon), it still doesn't work. Maybe I should try longer.
>
> Even sleep 20s does not work.
It is not about of timing. The init scripts execute when the OS starts,
while your .bashrc executes when you log in. The OS will not allow you
to log in until all init scrips are finished executing.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: exec-path not changed in autostart
[not found] ` <mailman.16510.1419027237.1147.help-gnu-emacs@gnu.org>
@ 2014-12-19 23:03 ` Xin Jin
0 siblings, 0 replies; 7+ messages in thread
From: Xin Jin @ 2014-12-19 23:03 UTC (permalink / raw)
To: help-gnu-emacs
On Friday, December 19, 2014 2:13:59 PM UTC-8, Óscar Fuentes wrote:
> Xin Jin <zariskij@gmail.com> writes:
>
> > On Friday, December 19, 2014 1:58:45 PM UTC-8, Xin Jin wrote:
> >> On Friday, December 19, 2014 1:54:34 PM UTC-8, Xin Jin wrote:
> >> > No, it doesn't. I added some paths to $PATH in .bashrc, and clearly they do not show up in exec-path by default.
> >> >
> >> > On Friday, December 19, 2014 1:46:31 PM UTC-8, Eli Zaretskii wrote:
> >> > > > Date: Fri, 19 Dec 2014 13:09:19 -0800 (PST)
> >> > > > From: Xin Jin <zariskij@gmail.com>
> >> > > > Injection-Date: Fri, 19 Dec 2014 21:09:20 +0000
> >> > > >
> >> > > > I use the following code to add the paths from the shell environment to exec-path:
> >> > > >
> >> > > > (setq exec-path
> >> > > > (append
> >> > > > (split-string-and-unquote (getenv "PATH") ":")
> >> > > > exec-path))
> >> > >
> >> > > Why do you need that? exec-path already includes the directories from
> >> > > $PATH, so the above sounds redundant.
> >>
> >> Hmm, so is that the .bashrc is processed too slowly so that $PATH hasn't updated?
> >>
> >> But even if I add (sleep 10s && emacs24 --daemon), it still doesn't work. Maybe I should try longer.
> >
> > Even sleep 20s does not work.
>
> It is not about of timing. The init scripts execute when the OS starts,
> while your .bashrc executes when you log in. The OS will not allow you
> to log in until all init scrips are finished executing.
Thanks. Actually I find out that .bashrc executes when a bash process starts, and .bash_profile is the one that starts when I log in.
So the problem is solved after I move the paths from .bashrc to .bash_profile,
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-12-19 23:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-19 21:09 exec-path not changed in autostart Xin Jin
2014-12-19 21:46 ` Eli Zaretskii
[not found] ` <mailman.16507.1419025590.1147.help-gnu-emacs@gnu.org>
2014-12-19 21:54 ` Xin Jin
2014-12-19 21:58 ` Xin Jin
2014-12-19 22:01 ` Xin Jin
2014-12-19 22:13 ` Óscar Fuentes
[not found] ` <mailman.16510.1419027237.1147.help-gnu-emacs@gnu.org>
2014-12-19 23:03 ` Xin Jin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).