Emacs 23,emacsclient参数? [英] Emacs 23, emacsclient arguments?

查看:58
本文介绍了Emacs 23,emacsclient参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在OS X Leopard上安装了Emacs 23,并试用了emacs服务器.我尝试了两种方式:(1)将(server-start)放入.emacs文件中,以及(2)在终端上运行emacs --daemon(在单独的试验中;不要同时进行).无论哪种情况,当我已经打开emacs框架并尝试使用emacsclient -t,-tty或-nw在OS X终端中打开单独的文件时,该文件总是在现有框架中打开,而不是在终端中打开描述:

I recently installed Emacs 23 (on OS X Leopard) and trying out the emacs server. I have tried both ways: (1) putting (server-start) in my .emacs file, and (2) running emacs --daemon at the terminal (in separate trials; not at the same time). In either case, when I have an emacs frame already open and try to open a separate file in the OS X terminal using emacsclient -t, -tty, or -nw, the file always opens in an existing frame rather than in the terminal as described:

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可以正常工作.您有什么想法吗?

However, emacsclient -c works as expected. Do you have any ideas what may be happening?

非常感谢!-斯蒂芬

推荐答案

感谢您的建议和回答-我认为我的解决方案是在.bash_profile中添加以下内容:

Thanks all for your suggestions and responses - I think my solution is to add the following to my .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"

我尝试使用emacs --daemon并按照建议由Emacs Client.app图标替换Emacs.app

I tried using emacs --daemon and replacing the Emacs.app with Emacs Client.app icon as suggested by

http://www.cubiclemuses.com/cm/articles/2009/07/30/emacs-23-for-os-x/

但是(1)守护进程似乎并未加载许多.emacs自定义设置;(2)当我退出Emacs Client时,它将完全退出Emacs并生成错误...

but (1) the daemon did not seem to load many of my .emacs customizations and (2) when I would quit Emacs Client it would quit Emacs altogether and generate errors...

所以我的解决方案是使用上面定义的bash别名;将行(服务器启动)添加到我的.emacs文件中,并将Emacs.app图标添加到我的OS X扩展坞中,以便我可以使用该图标或别名之一来启动emacs并打开新文件在运行的实例中,我还可以使用上面的别名或Emacs中的Cx Cf(或Cx b).

So my solution is to use the bash aliases as defined above; add the line, (server-start), to my .emacs file, and add the Emacs.app icon to my OS X dock so that I can use either the icon or one of the aliases to launch emacs, and to open new files in the running instance I can also use the aliases above or C-x C-f (or C-x b) in Emacs.

这篇关于Emacs 23,emacsclient参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆