From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: inherit the path environment from .bash_profile (Mac OS 10.5) Date: Fri, 06 Aug 2010 15:58:52 +1000 Organization: Unlimited download news at news.astraweb.com Message-ID: <87hbj85lk3.fsf@puma.rapttech.com.au> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1291859232 8719 80.91.229.12 (9 Dec 2010 01:47:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 01:47:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 02:47:08 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQVb8-00037S-GD for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 02:47:06 +0100 Original-Received: from localhost ([127.0.0.1]:49439 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQVb7-0004BO-UU for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 20:47:06 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!news-xfer.nntp.sonic.net!news.astraweb.com!border5.newsrouter.astraweb.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Nh4fZZlsG3T0BtvX2tmg1dGNgMY= Original-Lines: 58 Original-NNTP-Posting-Host: c36449e1.news.astraweb.com Original-X-Trace: DXC=>9bSVSO4o_DDIol_\Lk[aFL?0kYOcDh@JW\:Hm@YlDbJ1RU8R=ccZjK\6:o3aKBMRMb2dDA List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76411 Archived-At: Z 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