Emacs 23、emacsclient 参数?
我最近安装了 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 按预期工作。 您对可能发生的情况有什么想法吗?
非常感谢! -史蒂芬
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
However, emacsclient -c works as expected. Do you have any ideas what may be happening?
Thanks much! -Stephen
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您确定您使用的是正确的“emacsclient”二进制文件吗? 您需要
/Applications/Emacs.app/Contents/MacOS/bin/emacsclient
,默认情况下它不会在您的路径中。 如果您只是从命令行调用一个裸露的emacsclient
,您将从 Apple 附带的 Emacs 22.1 中获得emacsclient
。如果您运行
emacsclient --version
并得到以下信息:您没有得到正确的版本。
Are you sure you're using the right 'emacsclient' binary? You'll want
/Applications/Emacs.app/Contents/MacOS/bin/emacsclient
, and by default it will NOT be in your path. If you just invoke a bareemacsclient
from the command line, you'll get theemacsclient
from the Emacs 22.1 that Apple ships.If you run
emacsclient --version
and get this:You're not getting the right one.
感谢大家的建议和回复 - 我认为我的解决方案是将以下内容添加到我的 .bash_profile 中:
的建议,用 Emacs Client.app 图标替换 Emacs.app
我尝试使用 emacs --daemon 并按照http://www.cubiclemuses.com/cm/articles/ 2009/07/30/emacs-23-for-os-x/
但是 (1) 守护进程似乎没有加载我的许多 .emacs 自定义设置以及 (2) 当我退出 Emacs Client 时它会退出Emacs 完全并生成错误...
所以我的解决方案是使用上面定义的 bash 别名; 将行 (server-start) 添加到我的 .emacs 文件,并将 Emacs.app 图标添加到我的 OS X 停靠栏,以便我可以使用该图标或别名之一来启动 emacs 并打开新文件在运行实例中,我还可以使用上面的别名或 Emacs 中的 Cx Cf(或 Cx b)。
Thanks all for your suggestions and responses - I think my solution is to add the following to my .bash_profile:
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/
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...
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.app
,则应使用包内的可执行文件。 例如:包内还有一个 bin 目录:
如果您正在执行所有命令行操作,则可以使用 MacPort 更新终端版本:
这会推送 emacs-app @23.0.0_NS截至本文发布时,为 -9.0rc3_1。
If you installed the binary
Emacs.app
, you should use the executable inside the package. For example:There's also a
bin
directory inside the package:If you're doing all command line, you can just update your terminal version using MacPort:
which pushes
emacs-app @23.0.0_NS-9.0rc3_1
as of the time of this posting.我不经常在 OS X 上使用 emacs,但我习惯在启动/窗口管理器启动时启动
emacs --daemon
,让进程在后台运行。 这不是一个选择吗?我在我的 *shrc 文件中使用以下别名:
尽管我必须承认,我主要从窗口管理器中的绑定生成 emacs 框架(您可能会考虑 QuickKeys 或 Quicksliver 之类的东西),该触发:
emacsclient -c -n< /code> 或
emacs -n -e '(make-remember-frame)'
触发新的 org-remember 框架...希望这会有所帮助。
I don't regularly use emacs on OS X, but I've taken to just starting
emacs --daemon
on boot/window manager launch, keeping the process running in the background. Is this not an option?I use the following alias' in my *shrc files:
Though I must admit that I mostly spawn emacs frames from bindings in my window manager (you might consider something like QuickKeys or Quicksliver) that trigger:
emacsclient -c -n
oremacs -n -e '(make-remember-frame)'
which triggers a new org-remember frame...Hope this helps.