我最近安装了Emacs 23(在OS X Leopard上)并试用了emacs服务器.我尝试了两种方法:(1)将(server-start)放入我的.emacs文件中,以及(2)在终端上运行emacs --daemon(在单独的试验中;不在同一时间).在任何一种情况下,当我已经打开emacs框架并尝试使用emacsclient -t,-tty或-nw在OS X终端中打开单独的文件时,该文件始终在现有框架中打开,而不是在终端中打开描述:
http://www.gnu.org/software/emacs/manual/html_node/emacs/emacsclient-Options.html
http://emacs-fu.blogspot.com/2009/02/emacs-daemon.html
但是,emacsclient -c按预期工作.你对可能发生的事情有什么想法吗?
非常感谢!-Stephen
你确定你使用的是正确的'emacsclient'二进制文件吗?你会想要的/Applications/Emacs.app/Contents/MacOS/bin/emacsclient,默认情况下它不会在你的道路上.如果您只是从命令行调用裸机emacsclient,您将从emacsclientApple发布的Emacs 22.1中获取.
如果你运行emacsclient --version并得到这个:
$ emacsclient --version
emacsclient 22.1
Run Code Online (Sandbox Code Playgroud)
你找不到合适的人.
感谢大家的建议和回复 - 我认为我的解决方案是将以下内容添加到我的.bash_profile中:
## --- emacs ---
alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs'
## --- emacs client ---
## adapted from http://philipweaver.blogspot.com/2009/08/emacs-23.html
# start a windowed frame
alias ec="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n -c -a /Applications/Emacs.app/Contents/MacOS/Emacs"
# start a terminal frame
alias em="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -t -a /Applications/Emacs.app/Contents/MacOS/Emacs -nw"
# do not start a new frame
alias ea="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n -a /Applications/Emacs.app/Contents/MacOS/Emacs"
Run Code Online (Sandbox Code Playgroud)
我尝试使用emacs --daemon并用Emacs Client.app图标替换Emacs.app
http://www.cubiclemuses.com/cm/articles/2009/07/30/emacs-23-for-os-x/
但是(1)守护进程似乎没有加载我的许多.emacs自定义项;(2)当我退出Emacs客户端时,它会完全退出Emacs并产生错误......
所以我的解决方案是使用上面定义的bash别名; 将行(server-start)添加到我的.emacs文件中,并将Emacs.app图标添加到我的OS X dock中,以便我可以使用图标或其中一个别名来启动emacs,以及打开新文件在运行的实例中,我也可以在Emacs中使用上面的别名或Cx Cf(或Cx b).
| 归档时间: |
|
| 查看次数: |
4138 次 |
| 最近记录: |