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

From: Eli Zaretskii <[email-masked]>
Date: Tue, 01 Oct 2019 22:13:06 +0300

> From: Stefan Kangas <[email-masked]>
> Date: Tue, 1 Oct 2019 20:54:31 +0200
> Cc: Bruce Korb <[email-masked]>, [email-masked]
> 
> 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.

The FAQ has a problem, yes.  Why you looked there instead of the
manual is another question ;-)

> 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?

The FAQ is wrong and should be fixed.  server-socket-dir is a defvar,
whereas server-name is a defcustom, and that speaks volumes regarding
which one is user-level variable.

> >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?

I actually don't understand why do we have this text in the FAQ.  The
user manual documents this facility clearly enough (AFAIK), so the
most the FAQ should do is point to the manual.  Or maybe this whole
question should be deleted from the FAQ.  Does it say something that
the manual doesn't?