首页 > 系统服务 > 详细

在Spotlight里启动Emacs

时间:2015-10-03 07:21:00      阅读:246      评论:0      收藏:0      [点我收藏+]


使用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


在Spotlight里启动Emacs

原文:http://my.oschina.net/gadmyth/blog/513267

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!