diff options
| author | Eli Zaretskii | 2019-01-04 15:40:43 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-01-04 15:40:43 +0200 |
| commit | 775517307d9d5bb32cf6d58ae652e1e819aa95c3 (patch) | |
| tree | 7c9b44f91c66cb6b005a439849ec138620c9bb5b | |
| parent | 5f2aa328d158816aa4c40b1a6e603c6da9aff7b0 (diff) | |
| download | emacs-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.texi | 23 | ||||
| -rw-r--r-- | lisp/server.el | 9 |
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} |
| 1647 | server-name @key{RET} "foo" @key{RET}} sets the server name to | 1647 | server-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 |
| 1649 | name, using the @samp{-s} option (@pxref{emacsclient Options}). | 1649 | name, using the @samp{-s} or the @samp{-f} option (@pxref{emacsclient |
| 1650 | Options}), 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}), |
| 1652 | you can give each daemon its own server name like this: | 1654 | 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 | 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} |
| 1712 | containing the TCP information to be used by @command{emacsclient} to | 1714 | containing the TCP information to be used by @command{emacsclient} to |
| 1713 | connect to the server. The variable @code{server-auth-dir} specifies | 1715 | connect to the server. The variable @code{server-auth-dir} specifies |
| 1714 | the directory containing the server file; by default, this is | 1716 | the 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 |
| 1716 | permissions, the permissions of this directory determine which users | 1718 | permissions, the permissions of this directory determine which users |
| 1717 | can have their @command{emacsclient} processes talk to the Emacs | 1719 | can have their @command{emacsclient} processes talk to the Emacs |
| 1718 | server. | 1720 | server. If @code{server-name} is an absolute file name, the server |
| 1721 | file 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 |
| 1722 | a specific server file, use the @samp{-f} or @samp{--server-file} | 1725 | a specific server file, use the @samp{-f} or @samp{--server-file} |
| 1723 | option, or set the @env{EMACS_SERVER_FILE} environment variable | 1726 | option, 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 |
| 1725 | non-standard value, @command{emacsclient} needs an absolute file name | 1728 | non-standard value, or if @code{server-name} is set to an absolute |
| 1729 | file name, @command{emacsclient} needs an absolute file name | ||
| 1726 | to the server file, as the default @code{server-auth-dir} is | 1730 | to the server file, as the default @code{server-auth-dir} is |
| 1727 | hard-coded in @command{emacsclient} to be used as the directory for | 1731 | hard-coded in @command{emacsclient} to be used as the directory for |
| 1728 | resolving relative filenames. | 1732 | resolving 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} |
| 1917 | Connect to the Emacs server named @var{server-name}. The server name | 1921 | Connect to the Emacs server named @var{server-name}. (This option is |
| 1918 | is given by the variable @code{server-name} on the Emacs server. If | 1922 | not supported on MS-Windows.) The server name is given by the |
| 1919 | this option is omitted, @command{emacsclient} connects to the first | 1923 | variable @code{server-name} on the Emacs server. If this option is |
| 1920 | server it finds. (This option is not supported on MS-Windows.) | 1924 | omitted, @command{emacsclient} connects to the first server it finds. |
| 1925 | If you set @code{server-name} of the Emacs server to an absolute file | ||
| 1926 | name, give the same absolute file name as @var{server-name} to this | ||
| 1927 | option 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. |
| 257 | The command `server-start' makes use of this. It should not be | 257 | The command `server-start' makes use of this. It should not be |
| 258 | changed while a server is running." | 258 | changed while a server is running. |
| 259 | If this is a file name with no leading directories, Emacs will | ||
| 260 | create a socket file by that name under `server-socket-dir' | ||
| 261 | if `server-use-tcp' is nil, else under `server-auth-dir'. | ||
| 262 | If this is an absolute file name, it specifies where the socket | ||
| 263 | file will be created. To have emacsclient connect to the same | ||
| 264 | socket, use the \"-s\" switch for local non-TCP sockets, and | ||
| 265 | the \"-f\" switch otherwise." | ||
| 259 | :group 'server | 266 | :group 'server |
| 260 | :type 'string | 267 | :type 'string |
| 261 | :version "23.1") | 268 | :version "23.1") |