aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-01-04 15:40:43 +0200
committerEli Zaretskii2019-01-04 15:40:43 +0200
commit775517307d9d5bb32cf6d58ae652e1e819aa95c3 (patch)
tree7c9b44f91c66cb6b005a439849ec138620c9bb5b
parent5f2aa328d158816aa4c40b1a6e603c6da9aff7b0 (diff)
downloademacs-775517307d9d5bb32cf6d58ae652e1e819aa95c3.tar.gz
emacs-775517307d9d5bb32cf6d58ae652e1e819aa95c3.zip
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)
-rw-r--r--doc/emacs/misc.texi23
-rw-r--r--lisp/server.el9
2 files changed, 23 insertions, 9 deletions
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 41a540a7610..2d1617ef964 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -1646,7 +1646,9 @@ each one a unique @dfn{server name}, using the variable
1646@code{server-name}. For example, @kbd{M-x set-variable @key{RET} 1646@code{server-name}. For example, @kbd{M-x set-variable @key{RET}
1647server-name @key{RET} "foo" @key{RET}} sets the server name to 1647server-name @key{RET} "foo" @key{RET}} sets the server name to
1648@samp{foo}. The @code{emacsclient} program can specify a server by 1648@samp{foo}. The @code{emacsclient} program can specify a server by
1649name, using the @samp{-s} option (@pxref{emacsclient Options}). 1649name, using the @samp{-s} or the @samp{-f} option (@pxref{emacsclient
1650Options}), depending on whether or not the server uses a TCP socket
1651(@pxref{TCP Emacs server}).
1650 1652
1651 If you want to run multiple Emacs daemons (@pxref{Initial Options}), 1653 If you want to run multiple Emacs daemons (@pxref{Initial Options}),
1652you can give each daemon its own server name like this: 1654you 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 When you start a TCP Emacs server, Emacs creates a @dfn{server file} 1713 When you start a TCP Emacs server, Emacs creates a @dfn{server file}
1712containing the TCP information to be used by @command{emacsclient} to 1714containing the TCP information to be used by @command{emacsclient} to
1713connect to the server. The variable @code{server-auth-dir} specifies 1715connect to the server. The variable @code{server-auth-dir} specifies
1714the directory containing the server file; by default, this is 1716the default directory containing the server file; by default, this is
1715@file{~/.emacs.d/server/}. In the absence of a local socket with file 1717@file{~/.emacs.d/server/}. In the absence of a local socket with file
1716permissions, the permissions of this directory determine which users 1718permissions, the permissions of this directory determine which users
1717can have their @command{emacsclient} processes talk to the Emacs 1719can have their @command{emacsclient} processes talk to the Emacs
1718server. 1720server. If @code{server-name} is an absolute file name, the server
1721file is created where specified by that file name.
1719 1722
1720@vindex EMACS_SERVER_FILE@r{, environment variable} 1723@vindex EMACS_SERVER_FILE@r{, environment variable}
1721 To tell @command{emacsclient} to connect to the server over TCP with 1724 To tell @command{emacsclient} to connect to the server over TCP with
1722a specific server file, use the @samp{-f} or @samp{--server-file} 1725a specific server file, use the @samp{-f} or @samp{--server-file}
1723option, or set the @env{EMACS_SERVER_FILE} environment variable 1726option, or set the @env{EMACS_SERVER_FILE} environment variable
1724(@pxref{emacsclient Options}). If @code{server-auth-dir} is set to a 1727(@pxref{emacsclient Options}). If @code{server-auth-dir} is set to a
1725non-standard value, @command{emacsclient} needs an absolute file name 1728non-standard value, or if @code{server-name} is set to an absolute
1729file name, @command{emacsclient} needs an absolute file name
1726to the server file, as the default @code{server-auth-dir} is 1730to the server file, as the default @code{server-auth-dir} is
1727hard-coded in @command{emacsclient} to be used as the directory for 1731hard-coded in @command{emacsclient} to be used as the directory for
1728resolving relative filenames. 1732resolving relative filenames.
@@ -1914,10 +1918,13 @@ evaluation performed is for side-effect rather than result.
1914 1918
1915@item -s @var{server-name} 1919@item -s @var{server-name}
1916@itemx --socket-name=@var{server-name} 1920@itemx --socket-name=@var{server-name}
1917Connect to the Emacs server named @var{server-name}. The server name 1921Connect to the Emacs server named @var{server-name}. (This option is
1918is given by the variable @code{server-name} on the Emacs server. If 1922not supported on MS-Windows.) The server name is given by the
1919this option is omitted, @command{emacsclient} connects to the first 1923variable @code{server-name} on the Emacs server. If this option is
1920server it finds. (This option is not supported on MS-Windows.) 1924omitted, @command{emacsclient} connects to the first server it finds.
1925If you set @code{server-name} of the Emacs server to an absolute file
1926name, give the same absolute file name as @var{server-name} to this
1927option to instruct @command{emacsclient} to connect to that server.
1921 1928
1922@item -t 1929@item -t
1923@itemx --tty 1930@itemx --tty
diff --git a/lisp/server.el b/lisp/server.el
index 599f2728b99..a39b1cb46d4 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -255,7 +255,14 @@ are done with it in the server.")
255(defcustom server-name "server" 255(defcustom server-name "server"
256 "The name of the Emacs server, if this Emacs process creates one. 256 "The name of the Emacs server, if this Emacs process creates one.
257The command `server-start' makes use of this. It should not be 257The command `server-start' makes use of this. It should not be
258changed while a server is running." 258changed while a server is running.
259If this is a file name with no leading directories, Emacs will
260create a socket file by that name under `server-socket-dir'
261if `server-use-tcp' is nil, else under `server-auth-dir'.
262If this is an absolute file name, it specifies where the socket
263file will be created. To have emacsclient connect to the same
264socket, use the \"-s\" switch for local non-TCP sockets, and
265the \"-f\" switch otherwise."
259 :group 'server 266 :group 'server
260 :type 'string 267 :type 'string
261 :version "23.1") 268 :version "23.1")