开发者

How to avoid the message of "server-start" while opening another Emacs session?

开发者 https://www.devze.com 2023-03-14 07:26 出处:网络
I have a line (server-开发者_运维技巧start) in my .emacs for some reasons. Everything is fine when I launch a first session of Emacs, but when I open anther session, there is a buffer which shows:

I have a line (server-开发者_运维技巧start) in my .emacs for some reasons. Everything is fine when I launch a first session of Emacs, but when I open anther session, there is a buffer which shows:

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.

As I quite often open several Emacs, I am wondering if it is possible modify `.emacs' file so as to avoid this message in the beginning.

Could anyone help? Thank you very much!


Try:

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

Note that server-running-p does not appear in the manual, so conceivably this could break with future versions of Emacs.

0

精彩评论

暂无评论...
验证码 换一张
取 消