首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

OS X上的Emacs Deamon模式设置

2012-11-22 
OS X下的Emacs Deamon模式设置由于Emacs插件配置越来越多,启动速度都快赶超IDE了。所以试验了下daemon模式,

OS X下的Emacs Deamon模式设置

由于Emacs插件配置越来越多,启动速度都快赶超IDE了。所以试验了下daemon模式,效果不错。除了第一次启动daemon比较慢,后面的基本上是秒启。

一、安装emacs
    没安装Emacs的可以从[Emacs for Mac OS X]: http://emacsformacosx.com/builds下载安装。

二、创建一个daemon应用
    打开AppleScript编辑器,粘贴如下内容:

tell application "Terminal"do shell script "/Applications/Emacs.app/Contents/MacOS/Emacs --daemon >/dev/null 2>&1 &"end tell

保存到/Applications目录下,名字为“Emacs Daemon”,文件格式为“应用程序”。
   
三、创建一个client应用
     打开AppleSciprt编辑器,粘贴如下内容:
tell application "Terminal"tryset frameVisible to do shell script "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -e '(<= 2 (length (visible-frame-list)))'"if frameVisible is not "t" thendo shell script "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -c -n"end ifon errordo shell script "/Applications/Emacs.app/Contents/MacOS/Emacs --daemon"do shell script "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -c -n"end tryend telltell application "Emacs" to activate

保存到/Applications目录下,名字为“Emacs Client”,文件格式为“应用程序”。

配置完毕。启动的时候先启动Emacs Daemon应用。之后都是使用Emacs Client启动就可以了。

热点排行