GNU bug report logs - #66667
[PATCH] Socket forwarding in emacsclient --tramp-prefix example

Previous Next

Package: emacs;

Reported by: p.d.oliver <at> mavit.org.uk

Date: Sat, 21 Oct 2023 15:03:01 UTC

Severity: wishlist

Tags: patch

Fixed in version 29.4

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: p.d.oliver <at> mavit.org.uk
Subject: bug#66667: closed (Re: bug#66667: [PATCH] Socket forwarding in
 emacsclient --tramp-prefix example)
Date: Wed, 10 Jan 2024 10:16:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#66667: [PATCH] Socket forwarding in emacsclient --tramp-prefix example

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 66667 <at> debbugs.gnu.org.

-- 
66667: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66667
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Michael Albinus <michael.albinus <at> gmx.de>
To: Peter Oliver <p.d.oliver <at> mavit.org.uk>
Cc: 66667-done <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#66667: [PATCH] Socket forwarding in emacsclient
 --tramp-prefix example
Date: Wed, 10 Jan 2024 11:14:46 +0100
Version: 29.2

Peter Oliver <p.d.oliver <at> mavit.org.uk> writes:

> I see from lib-src/emacsclient.c that they’re used only if
> SOCKETS_IN_FILE_SYSTEM is defined, which is only the case if WINDOWSNT
> is not defined.  I’ll update the wording not to imply that they don’t
> exist, only that we don’t use them.

Documentation was adapted in the emacs-29 branch, so I'm closing the
bug.

Best regards, Michael.

[Message part 3 (message/rfc822, inline)]
From: Peter Oliver <p.d.oliver <at> mavit.org.uk>
To: bug-gnu-emacs <at> gnu.org
Cc: Peter Oliver <git <at> mavit.org.uk>
Subject: [PATCH] Socket forwarding in emacsclient --tramp-prefix example
Date: Sat, 21 Oct 2023 16:01:27 +0100
Previously, the emacsclient --tramp-prefix documentation suggested
using it in conjunction with a forwarded TCP port.  However, OpenSSH
has supported forwarding sockets since version 6.7 (released 2014), so
let’s suggest that instead.  Sockets require less manual configuration
than ports, are less likely to clash, and are more secure, so will be
a better choice for the majority of people looking to set up this
facility for the first time.

* doc/emacs/misc.texi (emacsclient Options): Suggest forwarding sockets.
---
 doc/emacs/misc.texi | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index a05b7f6c6ea..93771832ff5 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -2158,8 +2158,9 @@ emacsclient Options
 Set the prefix to add to filenames for Emacs to locate files on remote
 machines (@pxref{Remote Files}) using TRAMP (@pxref{Top, The Tramp
 Manual,, tramp, The Tramp Manual}).  This is mostly useful in
-combination with using the Emacs server over TCP (@pxref{TCP Emacs
-server}).  By ssh-forwarding the listening port and making the
+combination with using the Emacs server from a remote host.  By
+ssh-forwarding the listening socket, or ssh-forwarding the listening
+port @pxref{TCP Emacs server} and making the
 @var{server-file} available on a remote machine, programs on the
 remote machine can use @command{emacsclient} as the value for the
 @env{EDITOR} and similar environment variables, but instead of talking
@@ -2171,16 +2172,13 @@ emacsclient Options
 effect as using the @samp{-T} option.  If both are specified, the
 command-line option takes precedence.
 
-For example, assume two hosts, @samp{local} and @samp{remote}, and
-that the local Emacs listens on tcp port 12345.  Assume further that
-@file{/home} is on a shared file system, so that the server file
-@file{~/.emacs.d/server/server} is readable on both hosts.
+For example, assume two hosts, @samp{local} and @samp{remote}.
 
 @example
-local$ ssh -R12345:localhost:12345 remote
-remote$ export EDITOR="emacsclient \
-        --server-file=server \
-        --tramp=/ssh:remote:"
+local$ ssh -R "/tmp/emacs-%r.socket":"$@{XDG_RUNTIME_DIR:-$@{TMPDIR:-/tmp@}/emacs%i@}$@{XDG_RUNTIME_DIR:+/emacs@}/server" remote
+remote$ export EMACS_SOCKET_NAME=/tmp/emacs-$USER.socket
+remote$ export EMACSCLIENT_TRAMP=/ssh:remote:
+remote$ export EDITOR=emacsclient
 remote$ $EDITOR /tmp/foo.txt #Should open in local emacs.
 @end example
 
-- 
2.41.0




This bug report was last modified 1 year and 41 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.