Commit 77551730 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Improve documentation of 'server-name'

* doc/emacs/misc.texi (Emacs Server, TCP Emacs server)
(emacsclient Options):
* lisp/server.el (server-name):  Document the usage of
'server-name' to specify the server file as an absolute file
name.  Do not merge to master.  (Bug#33934)
parent 5f2aa328
Pipeline #442 failed with stage
in 26 minutes and 44 seconds
...@@ -1646,7 +1646,9 @@ each one a unique @dfn{server name}, using the variable ...@@ -1646,7 +1646,9 @@ each one a unique @dfn{server name}, using the variable
@code{server-name}. For example, @kbd{M-x set-variable @key{RET} @code{server-name}. For example, @kbd{M-x set-variable @key{RET}
server-name @key{RET} "foo" @key{RET}} sets the server name to server-name @key{RET} "foo" @key{RET}} sets the server name to
@samp{foo}. The @code{emacsclient} program can specify a server by @samp{foo}. The @code{emacsclient} program can specify a server by
name, using the @samp{-s} option (@pxref{emacsclient Options}). name, using the @samp{-s} or the @samp{-f} option (@pxref{emacsclient
Options}), depending on whether or not the server uses a TCP socket
(@pxref{TCP Emacs server}).
If you want to run multiple Emacs daemons (@pxref{Initial Options}), If you want to run multiple Emacs daemons (@pxref{Initial Options}),
you can give each daemon its own server name like this: you can give each daemon its own server name like this:
...@@ -1711,18 +1713,20 @@ use @kbd{M-x server-generate-key} to get a random key. ...@@ -1711,18 +1713,20 @@ use @kbd{M-x server-generate-key} to get a random key.
When you start a TCP Emacs server, Emacs creates a @dfn{server file} When you start a TCP Emacs server, Emacs creates a @dfn{server file}
containing the TCP information to be used by @command{emacsclient} to containing the TCP information to be used by @command{emacsclient} to
connect to the server. The variable @code{server-auth-dir} specifies connect to the server. The variable @code{server-auth-dir} specifies
the directory containing the server file; by default, this is the default directory containing the server file; by default, this is
@file{~/.emacs.d/server/}. In the absence of a local socket with file @file{~/.emacs.d/server/}. In the absence of a local socket with file
permissions, the permissions of this directory determine which users permissions, the permissions of this directory determine which users
can have their @command{emacsclient} processes talk to the Emacs can have their @command{emacsclient} processes talk to the Emacs
server. server. If @code{server-name} is an absolute file name, the server
file is created where specified by that file name.
@vindex EMACS_SERVER_FILE@r{, environment variable} @vindex EMACS_SERVER_FILE@r{, environment variable}
To tell @command{emacsclient} to connect to the server over TCP with To tell @command{emacsclient} to connect to the server over TCP with
a specific server file, use the @samp{-f} or @samp{--server-file} a specific server file, use the @samp{-f} or @samp{--server-file}
option, or set the @env{EMACS_SERVER_FILE} environment variable option, or set the @env{EMACS_SERVER_FILE} environment variable
(@pxref{emacsclient Options}). If @code{server-auth-dir} is set to a (@pxref{emacsclient Options}). If @code{server-auth-dir} is set to a
non-standard value, @command{emacsclient} needs an absolute file name non-standard value, or if @code{server-name} is set to an absolute
file name, @command{emacsclient} needs an absolute file name
to the server file, as the default @code{server-auth-dir} is to the server file, as the default @code{server-auth-dir} is
hard-coded in @command{emacsclient} to be used as the directory for hard-coded in @command{emacsclient} to be used as the directory for
resolving relative filenames. resolving relative filenames.
...@@ -1914,10 +1918,13 @@ evaluation performed is for side-effect rather than result. ...@@ -1914,10 +1918,13 @@ evaluation performed is for side-effect rather than result.
@item -s @var{server-name} @item -s @var{server-name}
@itemx --socket-name=@var{server-name} @itemx --socket-name=@var{server-name}
Connect to the Emacs server named @var{server-name}. The server name Connect to the Emacs server named @var{server-name}. (This option is
is given by the variable @code{server-name} on the Emacs server. If not supported on MS-Windows.) The server name is given by the
this option is omitted, @command{emacsclient} connects to the first variable @code{server-name} on the Emacs server. If this option is
server it finds. (This option is not supported on MS-Windows.) omitted, @command{emacsclient} connects to the first server it finds.
If you set @code{server-name} of the Emacs server to an absolute file
name, give the same absolute file name as @var{server-name} to this
option to instruct @command{emacsclient} to connect to that server.
@item -t @item -t
@itemx --tty @itemx --tty
......
...@@ -255,7 +255,14 @@ are done with it in the server.") ...@@ -255,7 +255,14 @@ are done with it in the server.")
(defcustom server-name "server" (defcustom server-name "server"
"The name of the Emacs server, if this Emacs process creates one. "The name of the Emacs server, if this Emacs process creates one.
The command `server-start' makes use of this. It should not be The command `server-start' makes use of this. It should not be
changed while a server is running." changed while a server is running.
If this is a file name with no leading directories, Emacs will
create a socket file by that name under `server-socket-dir'
if `server-use-tcp' is nil, else under `server-auth-dir'.
If this is an absolute file name, it specifies where the socket
file will be created. To have emacsclient connect to the same
socket, use the \"-s\" switch for local non-TCP sockets, and
the \"-f\" switch otherwise."
:group 'server :group 'server
:type 'string :type 'string
:version "23.1") :version "23.1")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment