3

When I run emacs --daemon it creates a socket at /tmp/emacs1000/server

How can I tell it to use a different location?

1
  • The only thing I managed to find is changing the name of the file it uses, by giving the daemon a name. I didn't notice anything of potential interest in server.el, and there is a chance this is just hard-coded.
    – user12563
    Oct 5, 2017 at 17:52

1 Answer 1

4

The directory where the socket is created is controlled by this variable:

(defvar server-socket-dir
  (and (featurep 'make-network-process '(:family local))
   (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid)))
  "The directory in which to place the server socket.
  If local sockets are not supported, this is nil.")

If you use tcp sockets (probably not a good idea), the variable is server-auth-dir with value ~/.emacs.d/server/.

The name of the socket is the name of the server, as @DoMiNeLa10 notes in a comment, and can be changed by customizing the value of the variable server-name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.