From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marius Hofert Newsgroups: gmane.emacs.help Subject: Emacs on Mac 10.7 (Lion): how to get PATH as in terminal? Date: Sun, 23 Oct 2011 22:58:35 +0200 Message-ID: <89B4BD3D-602B-4B69-961E-2567B30B916B@math.ethz.ch> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1319403534 6789 80.91.229.12 (23 Oct 2011 20:58:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 23 Oct 2011 20:58:54 +0000 (UTC) To: Emacs help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 23 22:58:48 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RI583-0006xj-08 for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Oct 2011 22:58:47 +0200 Original-Received: from localhost ([::1]:36978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RI582-000608-Gz for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Oct 2011 16:58:46 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:53218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RI57y-000602-1E for help-gnu-emacs@gnu.org; Sun, 23 Oct 2011 16:58:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RI57w-0004sv-Jf for help-gnu-emacs@gnu.org; Sun, 23 Oct 2011 16:58:41 -0400 Original-Received: from edge10.ethz.ch ([82.130.75.186]:34053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RI57w-0004sq-6y for help-gnu-emacs@gnu.org; Sun, 23 Oct 2011 16:58:40 -0400 Original-Received: from CAS20.d.ethz.ch (172.31.51.110) by edge10.ethz.ch (82.130.75.186) with Microsoft SMTP Server (TLS) id 14.1.339.1; Sun, 23 Oct 2011 22:58:36 +0200 Original-Received: from 80-218-247-21.dclient.hispeed.ch (80.218.247.21) by CAS20.d.ethz.ch (172.31.51.110) with Microsoft SMTP Server (TLS) id 14.1.339.1; Sun, 23 Oct 2011 22:58:36 +0200 X-Mailer: Apple Mail (2.1251.1) X-Originating-IP: [80.218.247.21] X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.130.75.186 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82626 Archived-At: Hi, I know this is an old problem, but I still couldn't figure it out with = the tricks I found. I work with the emacs 23.3 on Mac OS X 10.7.2 (Lion), installed from = http://emacsformacosx.com/ When I open a shell with M-x shell and type echo $PATH, I get: /usr/bin:/bin:/usr/sbin:/sbin When I do the same in Mac's Terminal, I get: = /Applications/Emacs.app/Contents/MacOS/:/usr/bin:/bin:/usr/sbin:/sbin:/usr= /local/bin:/usr/X11/bin:/usr/texbin:/opt/local/bin:/opt/local/sbin Question: How do I get the same PATH in emacs than in the terminal? Trials: 1) fixpath.el: (add-to-list 'load-path "~/.emacs.d/fixpath"); see = https://svn.fsg.ulaval.ca/svn-pub/vgoulet/emacs-modified/macos/tags/Emacs-= 23.3-modified-3/fixpath.el (require 'fixpath) 2) emacs wiki (http://www.emacswiki.org/emacs/EmacsApp#toc2) ;; add "defaults..." to /etc/profile: if [ -x /usr/libexec/path_helper ]; then eval `/usr/libexec/path_helper -s` defaults write $HOME/.MacOSX/environment PATH "$PATH" fi ;; add the following to .emacs: (add-to-list 'exec-path "/usr/bin") 3) another solution posted on the emacs wiki page: ;; read in PATH from .bashrc (and add at least those directories) ;; see http://www.emacswiki.org/emacs/EmacsApp#toc5 (if (not (getenv "TERM_PROGRAM")) (setenv "PATH" (shell-command-to-string "source $HOME/.bashrc && printf = $PATH"))) Cheers, Marius=