diff options
| author | Peter Oliver | 2024-04-10 10:42:39 +0200 |
|---|---|---|
| committer | Michael Albinus | 2024-04-10 10:42:39 +0200 |
| commit | 6a0bb7beae3ed4e3d2b420b73abcfaada38f53ee (patch) | |
| tree | 9eb7d94768f9ae7d3deb87b292ad0598fa995990 | |
| parent | 859b4227e3de9f8e7bc26367540aa315cefc37dc (diff) | |
| download | emacs-6a0bb7beae3ed4e3d2b420b73abcfaada38f53ee.tar.gz emacs-6a0bb7beae3ed4e3d2b420b73abcfaada38f53ee.zip | |
* doc/emacs/misc.texi (emacsclient Options): Suggest forwarding sockets.
(Bug#66667)
| -rw-r--r-- | doc/emacs/misc.texi | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 488f6de04ed..41e37fd094e 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -2161,8 +2161,9 @@ terminal. | |||
| 2161 | Set the prefix to add to filenames for Emacs to locate files on remote | 2161 | Set the prefix to add to filenames for Emacs to locate files on remote |
| 2162 | machines (@pxref{Remote Files}) using TRAMP (@pxref{Top, The Tramp | 2162 | machines (@pxref{Remote Files}) using TRAMP (@pxref{Top, The Tramp |
| 2163 | Manual,, tramp, The Tramp Manual}). This is mostly useful in | 2163 | Manual,, tramp, The Tramp Manual}). This is mostly useful in |
| 2164 | combination with using the Emacs server over TCP (@pxref{TCP Emacs | 2164 | combination with using the Emacs server from a remote host. By |
| 2165 | server}). By ssh-forwarding the listening port and making the | 2165 | ssh-forwarding the listening socket, or ssh-forwarding the listening |
| 2166 | port @pxref{TCP Emacs server} and making the | ||
| 2166 | @var{server-file} available on a remote machine, programs on the | 2167 | @var{server-file} available on a remote machine, programs on the |
| 2167 | remote machine can use @command{emacsclient} as the value for the | 2168 | remote machine can use @command{emacsclient} as the value for the |
| 2168 | @env{EDITOR} and similar environment variables, but instead of talking | 2169 | @env{EDITOR} and similar environment variables, but instead of talking |
| @@ -2174,16 +2175,29 @@ Setting the environment variable @env{EMACSCLIENT_TRAMP} has the same | |||
| 2174 | effect as using the @samp{-T} option. If both are specified, the | 2175 | effect as using the @samp{-T} option. If both are specified, the |
| 2175 | command-line option takes precedence. | 2176 | command-line option takes precedence. |
| 2176 | 2177 | ||
| 2177 | For example, assume two hosts, @samp{local} and @samp{remote}, and | 2178 | For example, assume two hosts, @samp{local} and @samp{remote}. |
| 2178 | that the local Emacs listens on tcp port 12345. Assume further that | 2179 | |
| 2180 | @example | ||
| 2181 | local$ ssh -R "/home/%r/.emacs.socket":"$@{XDG_RUNTIME_DIR:-$@{TMPDIR:-/tmp@}/emacs%i@}$@{XDG_RUNTIME_DIR:+/emacs@}/server" remote | ||
| 2182 | remote$ export EMACS_SOCKET_NAME=$HOME/.emacs.socket | ||
| 2183 | remote$ export EMACSCLIENT_TRAMP=/ssh:remote: | ||
| 2184 | remote$ export EDITOR=emacsclient | ||
| 2185 | remote$ $EDITOR /tmp/foo.txt #Should open in local emacs. | ||
| 2186 | @end example | ||
| 2187 | |||
| 2188 | If you are using a platform where @command{emacsclient} does not use | ||
| 2189 | Unix domain sockets (i.e., MS-Windows), or your SSH implementation is | ||
| 2190 | not able to forward them (e.g., OpenSSH before version 6.7), you can | ||
| 2191 | forward a TCP port instead. In this example, assume that the local | ||
| 2192 | Emacs listens on tcp port 12345. Assume further that | ||
| 2179 | @file{/home} is on a shared file system, so that the server file | 2193 | @file{/home} is on a shared file system, so that the server file |
| 2180 | @file{~/.emacs.d/server/server} is readable on both hosts. | 2194 | @file{~/.emacs.d/server/server} is readable on both hosts. |
| 2181 | 2195 | ||
| 2182 | @example | 2196 | @example |
| 2183 | local$ ssh -R12345:localhost:12345 remote | 2197 | local$ ssh -R12345:localhost:12345 remote |
| 2184 | remote$ export EDITOR="emacsclient \ | 2198 | remote$ export EMACS_SERVER_FILE=server |
| 2185 | --server-file=server \ | 2199 | remote$ export EMACSCLIENT_TRAMP=/ssh:remote: |
| 2186 | --tramp=/ssh:remote:" | 2200 | remote$ export EDITOR=emacsclient |
| 2187 | remote$ $EDITOR /tmp/foo.txt #Should open in local emacs. | 2201 | remote$ $EDITOR /tmp/foo.txt #Should open in local emacs. |
| 2188 | @end example | 2202 | @end example |
| 2189 | 2203 | ||