11

I started a Emacs in my terminal, and then started running Emacs server inside it by M-x server-start. Now I would like to cancel running the Emacs server without exiting the Emacs process. There seems to be no command for that. How can i do that? Thanks.

2 Answers 2

13

The command to do that from inside emacs is

M-x server-mode

The first time you run it, it'll restart the server it's running. The second time, it'll stop the server.

To make sure that you're stopping the server, pass a non-positive prefix argument: M-0 M-x server-mode RET

2
  • 1
    Thanks. what is the difference between it and M-x server-start for starting the server?
    – Tim
    Aug 15, 2014 at 6:01
  • 1
    I was wrong at first; it doesn't start the server if it isn't running already, it just restarts it if it is.
    – Jenny D
    Aug 15, 2014 at 6:02
4

You can stop the server by running server-force-delete, e.g. interactively by doing M-x server-force-delete.

1
  • In my attempts to use this, it just deletes the socket file that the server is using to accept connections from clients, but the server process continues running.
    – mtraceur
    Mar 30, 2023 at 22:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .