When I run emacs --daemon
it creates a socket at /tmp/emacs1000/server
How can I tell it to use a different location?
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
.
server.el
, and there is a chance this is just hard-coded.