使 PATH 和其他环境变量在 emacs 中可用 [英] Making the PATH and other environment variables available in emacs

查看:37
本文介绍了使 PATH 和其他环境变量在 emacs 中可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 OSX 中使用 emacs 有时会很麻烦.

Working with emacs in OSX can some times be troubling.

我交替使用 Terminal.app 应用程序和 emace shell 这两个都使用 bash,并且两者似乎都可以工作,但是我确实遇到了两个问题,即两者的环境设置不相同.

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.

我正在运行来自 emacs 的 OSX Lion 和 emacs 24 的全新安装,并且想要环境变量在 emacs shell 中,使其与 osx 下的 Terminal.app 中的相同.我该如何解决?

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?

推荐答案

只需安装很棒的小包 exec-path-from-shell 就大功告成了!它会自动将您的 emacs exec-path 设置为与 zsh/bash 配置中的 PATH 相同.

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.

它还允许您像这样复制其他 shell 变量的值:

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

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

这篇关于使 PATH 和其他环境变量在 emacs 中可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆