help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inherit the path environment from .bash_profile (Mac OS 10.5)


From: Tim X
Subject: Re: inherit the path environment from .bash_profile (Mac OS 10.5)
Date: Wed, 08 Dec 2010 15:23:22 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Z <zell08v@orange.fr> writes:

> Hello,
>
> Is there a way to inherit the path environments of .bash_profile, when we
> lance emacs directly from the dock of Macs?
>
> In fact, I am using Mac OS X 10.5. I launch carbon emacs from the dock (which
> is the icons list normally at the bottom of the screen) . Then, if I invoke a
> shell from within emacs, it does not inherit the path environment defined at
> .bash_profile !
>
> So in my case, how can I achieve this inheritance of path environments? Maybe
> it suffices to add something at the initialization file .emacs?
>
> Thank you for your ideas.
>

I suspect the problem is similar to the one which can occur from X
windows when starting a program from a launcher etc. The issue arrives
because the windowing system is started within a non-login shell, which
emans the shell profile file is not run and therefore, none of the env
settings, such as path, are inherited by any of the sub-processes run. 

There are a couple of solutions.

1. Under X, you can add the switch to make the parent process that runs
the window manager a login shell. Not sure how this can be done under
OSX. Under X, it usually involdes making the sh/bash shell that runs
your xsession a login shell with -l or --login.

2. The docs to shell mode have the following sections

If a file `~/.emacs_SHELLNAME' exists, or `~/.emacs.d/init_SHELLNAME.sh',
it is given as initial input (but this may be lost, due to a timing
error, if the shell discards input when it starts up).

and 

The shell file name (sans directories) is used to make a symbol name
such as `explicit-csh-args'.  If that symbol is a variable,
its value is used as a list of arguments when invoking the shell.
Otherwise, one argument `-i' is passed to the shell.

You could try putting 

source ~/.bash_profile 

into ~/.emacs_bash or possibly, putting 

(defvar explicit_bash_args "-li")

could work.

Tim

-- 
tcross (at) rapttech dot com dot au


reply via email to

[Prev in Thread] Current Thread [Next in Thread]