Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
745 views
in Technique[技术] by (71.8m points)

macos - Making the PATH and other environment variables available in emacs

Working with emacs in OSX can some times be troubling.

I interchange with using the Terminal.app application and the emace shell both of these use bash, and both seem to work, I do however have the problem that the environment is not setup identically in both.

I'm running a clean installation of OSX Lion, and emacs 24 from emacs and would like for the environment variables in the emacs shell to make the same as in the Terminal.app under osx. How do I fix that?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Just install the awesome little package exec-path-from-shell and you're done! It will automatically set your emacs exec-path to be same as the PATH in your zsh/bash config.

It will also allow you to copy the values of other shell variables like this:

(exec-path-from-shell-copy-env "PYTHONPATH")

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...