在Emacs minibuffer中访问OS X / UNIX环境变量 [英] Accessing OS X / UNIX environment variables in Emacs minibuffer
问题描述
export WORK = / Users / myname / Documents / otherpaths / Work
所以要打开文件,我可以输入minibuffer:
查找文件:$ WORK / projectname / filename.txt
或为了节省自己输入整个文件路径的麻烦。
我发现了一些编辑指令〜/ .MacOSX / environment.plist,.profile,和.login档案:
http ://www.emacswiki.org/emacs/CarbonEmacsPackage
但似乎不起作用,我不确定它是否适用。我想知道有没有人知道解决方案?感谢您的预期,
-Stephen
你可以告诉emacs通过放置一个像
(setenvWORK/ Users / myname / Documents / otherpaths / Work)的任何环境变量您的emacs配置文件(.emacs,.emacs.d / init.el或任何您使用的内容)中的
)
Aquamacs和CarbonEmacs可能使用一些技巧来实现,而无需手动指定。看看两者的源代码。
I compiled Emacs 23 on OS X Leopard and I am loving it. But one thing I noticed when I switched from Aquamancs is that I am no longer able to access my environment variables that I specify in my .bash_profile file. For instance, I have a line:
export WORK=/Users/myname/Documents/otherpaths/Work
So to open files I can type in the minibuffer:
Find file: $WORK/projectname/filename.txt
or something to that effect, to save myself the trouble of typing the whole file path.
I found some instructions on editing ~/.MacOSX/environment.plist, .profile, and .login files from this site:
http://www.emacswiki.org/emacs/CarbonEmacsPackage
but does not appear to work and I am not certain it is applicable. I wonder if anyone knows of a solution? Thanks in anticipation,
-Stephen
you can tell emacs any environment variable by putting a line like
(setenv "WORK" "/Users/myname/Documents/otherpaths/Work")
in your emacs config file (.emacs, .emacs.d/init.el or whatever you use)
Probably Aquamacs and CarbonEmacs uses some tricks to achieve that without specifying it by hand. Take a look at the source code of both.
这篇关于在Emacs minibuffer中访问OS X / UNIX环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!