Subject: bug#20675: 24.3; emacsclient cannot talk to emacs

From: Stefan Kangas <[email-masked]>
Date: Tue, 1 Oct 2019 20:54:31 +0200

Eli Zaretskii <[email-masked]> writes:

> > I see that server-socket-dir is documented in the Emacs FAQ, but not
> > at all in the manual.
>
> That's because the right way of controlling this is by customizing
> server-name, not server-socket-dir.  See the user manual about
> server-name.

Right, but then it still seems like the documentation has a problem.

For starters, server-socket-dir is extensively documented in the FAQ,
while server-name is not at all mentioned.  Does that really make
sense if we want users to use server-name?

>From the FAQ:

> Emacs by default creates a Unix domain socket
> named ‘server’ in a well-known directory, typically
> ‘$XDG_RUNTIME_DIR/emacs’ if Emacs is running under an X Window
> System desktop and ‘$TMPDIR/emacsUSERID’ otherwise.  See the
> variable ‘server-socket-dir’.  Traditionally, Emacs used
> ‘$TMPDIR/emacsUSERID’ even when running under an X desktop; if you
> prefer this traditional (and less-secure) behavior, you can set the
> environment variable ‘EMACS_SOCKET_NAME’ to
> ‘$TMPDIR/emacsUSERID/server’ before invoking Emacs and
> ‘emacsclient’, although it will be your responsibility to create
> the directory ‘$TMPDIR/emacsUSERID’ with appropriate ownership and
> permissions.

Perhaps this entire text should be moved to the doc string of the
sparsely documented server-socket-dir, with a note that the user
should use server-name instead?  And the FAQ updated to direct users
to use server-name?

Best regards,
Stefan Kangas