使用Apple Script生成Application来启动Emacs Daemon 和 EmacsClient
on launch_emacs_client() tell application "Terminal" do script "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -c &" in front window end tell end launch_emacs_client set emacs_daemon_count to (do shell script "ps aux | grep Emacs | grep daemon | wc -l") as number if emacs_daemon_count ≤ 1 then do shell script "/Applications/Emacs.app/Contents/MacOS/Emacs --daemon" launch_emacs_client() else launch_emacs_client() tell application "Emacs" to activate end if
原文:http://my.oschina.net/gadmyth/blog/513267