From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: inherit the path environment from .bash_profile (Mac OS 10.5)
Date: Fri, 06 Aug 2010 15:58:52 +1000 [thread overview]
Message-ID: <87hbj85lk3.fsf@puma.rapttech.com.au> (raw)
In-Reply-To: mailman.0.1281064508.32647.help-gnu-emacs@gnu.org
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
next parent reply other threads:[~2010-08-06 5:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.0.1281064508.32647.help-gnu-emacs@gnu.org>
2010-08-06 5:58 ` Tim X [this message]
2010-08-06 7:15 ` inherit the path environment from .bash_profile (Mac OS 10.5) Xah Lee
[not found] <mailman.1.1281064641.32647.help-gnu-emacs@gnu.org>
2010-08-06 12:02 ` Inherit " Elena
2010-08-06 3:17 Z
2010-08-06 8:47 ` Peter Dyballa
2010-08-06 14:04 ` Jim Crossley
2010-08-06 15:27 ` Peter Dyballa
2010-08-08 17:54 ` Andrea Crotti
2010-08-06 12:09 ` Andrea Crotti
-- strict thread matches above, loose matches on Subject: below --
2010-08-06 3:15 inherit " Z
2010-08-06 14:00 ` Jim Crossley
2010-08-06 15:36 ` Peter Dyballa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87hbj85lk3.fsf@puma.rapttech.com.au \
--to=timx@nospam.dev.null \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.