diff options
| author | Eli Zaretskii | 2019-01-04 15:55:59 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-01-04 15:55:59 +0200 |
| commit | f6eacc468b8539be482260fa569e7b5ece07f4a2 (patch) | |
| tree | b15f8099a23bacfcf562c23d1fef5011ef0bea35 | |
| parent | fe4922cbf01fa9161ffa142fc70972098d48186f (diff) | |
| download | emacs-f6eacc468b8539be482260fa569e7b5ece07f4a2.tar.gz emacs-f6eacc468b8539be482260fa569e7b5ece07f4a2.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. (Bug#33934)
| -rw-r--r-- | doc/emacs/misc.texi | 29 | ||||
| -rw-r--r-- | lisp/server.el | 9 |
2 files changed, 26 insertions, 12 deletions
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 13e18f8a71d..a3aa71e2672 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -1693,7 +1693,9 @@ each one a unique @dfn{server name}, using the variable | |||
| 1693 | @code{server-name}. For example, @kbd{M-x set-variable @key{RET} | 1693 | @code{server-name}. For example, @kbd{M-x set-variable @key{RET} |
| 1694 | server-name @key{RET} "foo" @key{RET}} sets the server name to | 1694 | server-name @key{RET} "foo" @key{RET}} sets the server name to |
| 1695 | @samp{foo}. The @code{emacsclient} program can specify a server by | 1695 | @samp{foo}. The @code{emacsclient} program can specify a server by |
| 1696 | name, using the @samp{-s} option (@pxref{emacsclient Options}). | 1696 | name, using the @samp{-s} or the @samp{-f} option (@pxref{emacsclient |
| 1697 | Options}), depending on whether or not the server uses a TCP socket | ||
| 1698 | (@pxref{TCP Emacs server}). | ||
| 1697 | 1699 | ||
| 1698 | If you want to run multiple Emacs daemons (@pxref{Initial Options}), | 1700 | If you want to run multiple Emacs daemons (@pxref{Initial Options}), |
| 1699 | you can give each daemon its own server name like this: | 1701 | you can give each daemon its own server name like this: |
| @@ -1758,21 +1760,23 @@ use @kbd{M-x server-generate-key} to get a random key. | |||
| 1758 | When you start a TCP Emacs server, Emacs creates a @dfn{server file} | 1760 | When you start a TCP Emacs server, Emacs creates a @dfn{server file} |
| 1759 | containing the TCP information to be used by @command{emacsclient} to | 1761 | containing the TCP information to be used by @command{emacsclient} to |
| 1760 | connect to the server. The variable @code{server-auth-dir} specifies | 1762 | connect to the server. The variable @code{server-auth-dir} specifies |
| 1761 | the directory containing the server file; by default, this is | 1763 | the default directory containing the server file; by default, this is |
| 1762 | @file{~/.emacs.d/server/}. In the absence of a local socket with file | 1764 | @file{~/.emacs.d/server/}. In the absence of a local socket with file |
| 1763 | permissions, the permissions of this directory determine which users | 1765 | permissions, the permissions of this directory determine which users |
| 1764 | can have their @command{emacsclient} processes talk to the Emacs | 1766 | can have their @command{emacsclient} processes talk to the Emacs |
| 1765 | server. | 1767 | server. If @code{server-name} is an absolute file name, the server |
| 1768 | file is created where specified by that file name. | ||
| 1766 | 1769 | ||
| 1767 | @vindex EMACS_SERVER_FILE@r{, environment variable} | 1770 | @vindex EMACS_SERVER_FILE@r{, environment variable} |
| 1768 | To tell @command{emacsclient} to connect to the server over TCP with | 1771 | To tell @command{emacsclient} to connect to the server over TCP with |
| 1769 | a specific server file, use the @samp{-f} or @samp{--server-file} | 1772 | a specific server file, use the @samp{-f} or @samp{--server-file} |
| 1770 | option, or set the @env{EMACS_SERVER_FILE} environment variable | 1773 | option, or set the @env{EMACS_SERVER_FILE} environment variable |
| 1771 | (@pxref{emacsclient Options}). If @code{server-auth-dir} is set to a | 1774 | (@pxref{emacsclient Options}). If @code{server-auth-dir} is set to a |
| 1772 | non-standard value, @command{emacsclient} needs an absolute file name | 1775 | non-standard value, or if @code{server-name} is set to an absolute |
| 1773 | to the server file, as the default @code{server-auth-dir} is | 1776 | file name, @command{emacsclient} needs an absolute file name to the |
| 1774 | hard-coded in @command{emacsclient} to be used as the directory for | 1777 | server file, as the default @code{server-auth-dir} is hard-coded in |
| 1775 | resolving relative filenames. | 1778 | @command{emacsclient} to be used as the directory for resolving |
| 1779 | relative filenames. | ||
| 1776 | 1780 | ||
| 1777 | @node Invoking emacsclient | 1781 | @node Invoking emacsclient |
| 1778 | @subsection Invoking @code{emacsclient} | 1782 | @subsection Invoking @code{emacsclient} |
| @@ -1961,10 +1965,13 @@ evaluation performed is for side-effect rather than result. | |||
| 1961 | 1965 | ||
| 1962 | @item -s @var{server-name} | 1966 | @item -s @var{server-name} |
| 1963 | @itemx --socket-name=@var{server-name} | 1967 | @itemx --socket-name=@var{server-name} |
| 1964 | Connect to the Emacs server named @var{server-name}. The server name | 1968 | Connect to the Emacs server named @var{server-name}. (This option is |
| 1965 | is given by the variable @code{server-name} on the Emacs server. If | 1969 | not supported on MS-Windows.) The server name is given by the |
| 1966 | this option is omitted, @command{emacsclient} connects to the first | 1970 | variable @code{server-name} on the Emacs server. If this option is |
| 1967 | server it finds. (This option is not supported on MS-Windows.) | 1971 | omitted, @command{emacsclient} connects to the first server it finds. |
| 1972 | If you set @code{server-name} of the Emacs server to an absolute file | ||
| 1973 | name, give the same absolute file name as @var{server-name} to this | ||
| 1974 | option to instruct @command{emacsclient} to connect to that server. | ||
| 1968 | 1975 | ||
| 1969 | Alternatively, you can set the @env{EMACS_SOCKET_NAME} environment | 1976 | Alternatively, you can set the @env{EMACS_SOCKET_NAME} environment |
| 1970 | variable to point to the server socket. (The command-line option | 1977 | variable to point to the server socket. (The command-line option |
diff --git a/lisp/server.el b/lisp/server.el index 9020b09c5de..a5d5e561db5 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -270,7 +270,14 @@ been consumed.") | |||
| 270 | "server") | 270 | "server") |
| 271 | "The name of the Emacs server, if this Emacs process creates one. | 271 | "The name of the Emacs server, if this Emacs process creates one. |
| 272 | The command `server-start' makes use of this. It should not be | 272 | The command `server-start' makes use of this. It should not be |
| 273 | changed while a server is running." | 273 | changed while a server is running. |
| 274 | If this is a file name with no leading directories, Emacs will | ||
| 275 | create a socket file by that name under `server-socket-dir' | ||
| 276 | if `server-use-tcp' is nil, else under `server-auth-dir'. | ||
| 277 | If this is an absolute file name, it specifies where the socket | ||
| 278 | file will be created. To have emacsclient connect to the same | ||
| 279 | socket, use the \"-s\" switch for local non-TCP sockets, and | ||
| 280 | the \"-f\" switch otherwise." | ||
| 274 | :group 'server | 281 | :group 'server |
| 275 | :type 'string | 282 | :type 'string |
| 276 | :version "23.1") | 283 | :version "23.1") |