Is it possible to run emacs in server mode so remote clients can connect from remote locations via network? I'm just looking for the way to run emacs on remote powerful server and edit buffers locally using emacsclient while running compile
command remotelly. This looks much better approach then using ssh
session. Should not depend on network latency.
Asked
Active
Viewed 652 times
1

Archer
- 5,073
- 8
- 50
- 96
-
1are the files local or remote? if you just want to run emacs on a remote server, then you can run it over X11 forwarding or run it in a terminal over an ssh connection to the remote machine. – jtahlborn Nov 20 '13 at 20:25
-
Could you please describe your use-case more precisely? What's wrong with having the source code (have I understood correctly?) locally, compile it through `ssh` (ssh allows to execute a custom command w/o creation of new session) and push back to the server using any preferred VCS (e.g. git/svn/...)? – zweibaranov Nov 21 '13 at 06:11
-
I'd like to keep files remotely, run compilation on remote server, and just edit files locally over emacsclient. Basically I need emacs to run as generic network server. Don't wanna any voodoo with X11 forwarding or even ssh sessions due to network latency. – Archer Nov 21 '13 at 08:03
-
And why do you specifically want to use emacsclient? What's wrong with [TRAMP](https://www.gnu.org/software/tramp/#Overview)? – François Févotte Nov 21 '13 at 10:02
-
Well, I'd like emacs server on remote machine to share buffers among many connected users. – Archer Nov 21 '13 at 10:24
-
See also [Using Emacs server and emacsclient on other machines as other users](http://stackoverflow.com/questions/12546722/using-emacs-server-and-emacsclient-on-other-machines-as-other-users) – phils Nov 22 '13 at 05:38
-
AFAIK (someone please correct me if I'm wrong), emacsclient doesn't provide any "local" editing capabilities. The editing takes place in the server. If you have network latency issues talking to the server, I'm doubtful that emacsclient has any way of compensating for that. – phils Nov 22 '13 at 05:56
2 Answers
0
Basing on my comment above I'd recommend the following workflow:
- Retrieve the sources you work on to the local directory (via
scp
orgit
, whatever) - Introduce the required changed to the code
To compile the code on remote server specify a custom
compile-command
which will:- Push changed files back to the remote server. E.g.:
scp -r my-sources/ user-name@example.net:my-sources
or viagit push remote my-dev-branch
- Run the compilation command through ssh and show the output. E.g.:
ssh user-name@example.net -C "cd ~/my-sourcesl; make && ./bin/compiled-app"
- Push changed files back to the remote server. E.g.:
note:
for smooth commands execution through ssh, there is should a configured key-based authentication.
The significant drawback here is that at least it might not run X11 applications correctly (or at all)

zweibaranov
- 570
- 4
- 11