From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: inherit the path environment from .bash_profile (Mac OS 10.5) Date: Fri, 6 Aug 2010 00:15:07 -0700 (PDT) Organization: http://groups.google.com Message-ID: <84a79521-4fdc-4ec0-a7c6-3f9f219187c1@u31g2000pru.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291864220 25311 80.91.229.12 (9 Dec 2010 03:10:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 03:10:20 +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 04:10:15 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 1PQWta-0001kz-A1 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 04:10:14 +0100 Original-Received: from localhost ([127.0.0.1]:41069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQWfi-00044R-9K for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 21:55:54 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!u31g2000pru.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 58 Original-NNTP-Posting-Host: 67.180.85.8 Original-X-Trace: posting.google.com 1281078907 29518 127.0.0.1 (6 Aug 2010 07:15:07 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 6 Aug 2010 07:15:07 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u31g2000pru.googlegroups.com; posting-host=67.180.85.8; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.125 Safari/533.4, gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:180445 comp.emacs:100304 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor 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:76517 Archived-At: On Aug 5, 8:15=C2=A0pm, Z wrote: > 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 environmen= t > 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. > > Z. this is from my emacs init file, wrote around 2004 or so. ; Carbon Emacs doesn't inherit shell's env. A workaround is to shart it from shell like this: =E2=80=9C/Applications/Emacs.app/Contents/MacOS/Em= acs &=E2=80=9D however, exiting the shell by Ctrl+D also kills your emacs. So a workaround is to use the nohub: =E2=80=9Cnohup /Applications/Emacs.app/ Contents/MacOS/Emacs &=E2=80=9D. However, Apple's Term has a feature such that closing the window (by clicking on the Red Light or Cmd+w) kills all processes started from it. So, the solution is to never close window by clicking or Cmd+w, instead, always use Ctrl+d. However, when ssh to remote server and running =E2=80=9Ctail -f=E2=80=9D, sometimes broke= n connection causes the session to hang. So you are left with a frozen ssh session where the remote server has disconnected. So, here you can't use Ctrl-d to close the window. If you close the window by clicking, then you'll kill any emacs you might have started from that window. Hot Damn. So, the optimal solution seems to get Carbon Emacs to start using the Mac's GUI way of inheriting env vars by the file =E2=80=9C~/.MacOSX/environment.plist=E2=80=9D. Though, that mean you gonna = maintain two sets of env vars. Shit. Therefore at the end, maybe just dup it in elisp and forget about all quality solutions. Software Industry is quite fucked anyway. This is peanuts. All this is due to the motherfucking unix fucking env var system fuck. Fuck unix and fuck the unixer's mothers. (setenv "PATH" "/Users/xah/bin:/usr/local/bin:/opt/local/bin:/ Developer/Tools:/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/ X11R6/bin:/usr/X11R6/bin") (setenv "MANPATH" "/usr/local/man/:/sw/share/man:/usr/share/man:/usr/ X11R6/man:/sw/lib/perl5/5.8.6/man") Xah =E2=88=91 http://xahlee.org/ =E2=98=84