【问题标题】:How to avoid the message of "server-start" while opening another Emacs session?打开另一个 Emacs 会话时如何避免“服务器启动”的消息?
【发布时间】:2011-06-19 00:43:06
【问题描述】:

由于某些原因,我的.emacs 中有一行(server-start)。当我启动 Emacs 的第一个会话时一切都很好,但是当我打开另一个会话时,有一个缓冲区显示:

Warning (server): Unable to start the Emacs server.
There is an existing Emacs server, named "server".
To start the server in this Emacs process, stop the existing
server or call `M-x server-force-delete' to forcibly disconnect it.

由于我经常打开几个 Emacs,我想知道是否可以修改 `.emacs' 文件以避免一开始出现此消息。

有人可以帮忙吗?非常感谢!

【问题讨论】:

  • 使用 server-start 背后的要点是,这样您只运行一次 emacs,并且作为服务器运行。接下来每次需要 emacs 时,实际上运行 emacsclient 并连接到已经运行的 emacs 服务器。此外,我认为在配置文件中包含任何内容不是一个好习惯,除非您知道它的用途。

标签: emacs


【解决方案1】:

试试:

(require 'server)
(or (server-running-p)
    (server-start))

请注意,手册中没有出现server-running-p,因此可以想象这可能会与未来版本的 Emacs 冲突。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-03-16
    • 2020-04-30
    • 1970-01-01
    • 2019-07-29
    • 1970-01-01
    • 2010-10-22
    • 1970-01-01
    相关资源
    最近更新 更多