3

I love emacsclient. It allows me to use a single Emacs frame for all my editing, also when programs want to open an editor (i.e. export EDITOR=emacsclient).

I'd like to have it work like this with virtual machines, too. I can use tramp to edit remote files with Emacs in my single-frame setup, and it works very well, but it's not enough. When I invoke git commit or sudoedit, I'll have to use the crappy terminal-based editor that happens to be installed on the remote machine.

So, is there anything like emacsclient that works across multiple machines?

2 Answers 2

5

Speculation: If you can ssh from the VM back to your local machine then the VM could probably invoke emacsclient on your local machine, with the appropriate tramp prefix to the remote file? Set up a script for that, and configure your remote EDITOR environment variable to match.

Sign up to request clarification or add additional context in comments.

3 Comments

Wow, this is an amazing idea, and it works! I whipped up such a script, see gist.github.com/850795.
Excellent. I may have to try this myself :)
+1. you can do this even if you can't ssh back from the VM to your local machine. you can run the Emacs server over TCP, use ssh -R to forward a port back to your local machine, then tell emacsclient to connect over that port. details in stackoverflow.com/questions/2231902/… and snarfed.org/emacsclient_in_tramp_remote_shells .
2

It could be you can do more with TRAMP than you think. First off, you may have noticed that /sudo: doesn't work for remote boxes, but TRAMP allows you to proxy to a remote box and then use any supported protocol, so in effect you can use /sudo: on a remote box. See tramp-default-proxies-alist.

You mentioned invoking git commit on a remote box. Have you considered using one of the Emacs git interfaces such as magit? They will work through TRAMP as well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.