unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: peder@klingenberg.no (Peder O. Klingenberg)
Cc: 26591@debbugs.gnu.org
Subject: bug#26591: 26.0.50; Using local emacs+tramp with remote emacsclient
Date: Fri, 28 Apr 2017 12:42:27 +0300	[thread overview]
Message-ID: <83k264na0s.fsf@gnu.org> (raw)
In-Reply-To: <m1pog5g2jm.fsf@klingenberg.no> (peder@klingenberg.no)

> From: peder@klingenberg.no (Peder O. Klingenberg)
> Date: Fri, 21 Apr 2017 18:15:25 +0200
> 
> My workstation is running a bleeding edge emacs full-screen in a
> dedicated display.  When working on a server, from time to time I use
> programs that invoke the shell EDITOR.  I can set EDITOR to emacsclient,
> but that will just open emacs on the remote machine, which is not what I
> want.  I want whatever editing job needs doing to pop up in my local
> fullscreen emacs.
> 
> I can ssh to the server, so obviously I can use my local emacs to edit
> files there via Tramp.  And server.el already has functionality for
> listening on a TCP port, which is easily forwarded over ssh (there are
> various hacks out there for forwarding unix domain sockets as well,
> which I haven't tried).
> 
> The missing piece is simply a way to let emacsclient instruct emacs that
> the files it passes to emacs are remote.  Attached is a patch for your
> consideration which accomplishes this.
> 
> Additionally, it would be handy to have some tooling for conveniently
> forwarding the correct ports and setting up EDITOR with the correct -T
> option on the remote machine, but that is outside the scope of emacs
> code, I think.

Thanks, I think this will be a welcome feature.  Please see a few
comments below.

> --- a/doc/emacs/misc.texi
> +++ b/doc/emacs/misc.texi
> @@ -1872,6 +1872,36 @@ emacsclient Options
>  server is using the graphical display, but if the Emacs server is
>  running on a text terminal, it creates a new frame in the current text
>  terminal.
> +
> +@item -T @var{tramp-prefix}
> +@itemx --tramp-prefix=@var{tramp-prefix}
> +@cindex @env{EMACSCLIENT_TRAMP} environment variable
> +Prefix to add to filenames for emacs to locate files on remote
> +machines through TRAMP.  This is mostly useful in combination with
> +setting @code{server-use-tcp} to non-@code{nil}, ssh-forwarding the
> +listening port, and making the @var{server-file} available to
> +@command{emacsclient}.

server-use-tcp is not described in the manual, so I think we should
add its description somewhere, and then reference that place from this
text.

> +For example, assume two hosts, @samp{local} and @samp{remote}, with
> +@samp{/home} on a shared file system, and that the local emacs listens
> +on tcp port 12345:

"/home" should be in @file, not @samp.  Also, I don't see "/home" used
anywhere in the example, so something is missing here.

> +@example
> +local$ ssh -R12345:localhost:12345 remote
> +remote$ export EDITOR="emacsclient \
> +        --server-file=server \
> +        --tramp=/ssh:remote:'

The value of EDITOR begins with a ", but ends with a ', which is
probably a mistake.

> +	  if (tramp_prefix && file_name_absolute_p (argv[i]))
> +	    quote_argument (emacs_socket, tramp_prefix);

Why the test for argv[i] being an absolute file name?  And if relative
file names cannot be supported, I think emacsclient should emit an
error message rather than silently ignoring --tramp.





  reply	other threads:[~2017-04-28  9:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 16:15 bug#26591: 26.0.50; Using local emacs+tramp with remote emacsclient Peder O. Klingenberg
2017-04-28  9:42 ` Eli Zaretskii [this message]
2017-04-28 11:29   ` Peder O. Klingenberg
2017-04-29 19:45   ` Peder O. Klingenberg
2017-05-19  8:54     ` Eli Zaretskii
2017-05-19 13:36       ` Peder O. Klingenberg
2017-05-19 14:35         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83k264na0s.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=26591@debbugs.gnu.org \
    --cc=peder@klingenberg.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).