all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs on Mac 10.7 (Lion): how to get PATH as in terminal?
@ 2011-10-23 20:58 Marius Hofert
  2011-10-23 21:17 ` Perry Smith
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Hofert @ 2011-10-23 20:58 UTC (permalink / raw)
  To: Emacs help

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-23 23:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-23 20:58 Emacs on Mac 10.7 (Lion): how to get PATH as in terminal? Marius Hofert
2011-10-23 21:17 ` Perry Smith
2011-10-23 21:57   ` Marius Hofert
2011-10-23 23:15     ` Perry Smith
2011-10-23 23:16       ` Marius Hofert

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.