If the '--socket-name' argument is unspecified, the environment
variable 'EMACS_SOCKET_NAME' is now consulted with the same
semantics. This mirrors the behavior of the '--server-file' argument,
and allows for easier configuration of emacsclient when the socket is
in a location other than 'TMPDIR' or '/tmp'.
* emacsclient.c (set_socket): Add support for the
EMACS_SOCKET_NAME environment variable. (Bug#33095)
* misc.texi (emacsclient Options):
* emacsclient.1: Document the EMACS_SOCKET_NAME environment
variable.
* etc/NEWS: Announce the new feature.
Copyright-paperwork-exempt: yes
this option is omitted, @command{emacsclient} connects to the first
server it finds. (This option is not supported on MS-Windows.)
+Alternatively, you can set the @env{EMACS_SOCKET_NAME} environment
+variable to point to the server socket. (The command-line option
+overrides the environment variable.)
+
@item -t
@itemx --tty
@itemx -nw
.TP
.B \-s, \-\-socket-name=FILENAME
use socket named FILENAME for communication.
+This can also be specified via the EMACS_SOCKET_NAME environment variable.
.TP
.B \-V, \-\-version
print version information and exit
\f
* Changes in Emacs 27.1
++++
+** emacsclient uses EMACS_SOCKET_NAME if --socket-name is not set.
+The behavior is identical to the EMACS_SERVER_FILE, in that the
+command line value will override the environment, and the natural
+default to TMPDIR, then /tmp, continues to apply.
+
+++
** The function 'read-passwd' uses '*' as default character to hide passwords.
#ifndef NO_SOCKETS_IN_FILE_SYSTEM
/* Explicit --socket-name argument. */
+ if (!socket_name)
+ socket_name = egetenv ("EMACS_SOCKET_NAME");
+
if (socket_name)
{
s = set_local_socket (socket_name);