Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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!

like image 248
SoftTimur Avatar asked Jun 18 '11 16:06

SoftTimur


People also ask

How do I know if my Emacs server is running?

In emacs check the value of server-socket-dir . Check if there are some files in this directory. If does, then the server is running.


1 Answers

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.

like image 178
Nemo Avatar answered Oct 01 '22 09:10

Nemo