This project provides remote Emacs integration. Basically, if you want to run Emacs on a remote server via SSH, you can integrate it with your local machine's clipboard and web browser.
There are two parts:
reintegrate.el
, an Emacs packageemacs-integration
, an HTTP server
reintegrate.el
in the remote Emacs sends HTTP requests to
emacs-integration
running on your local machine through a forwarded
port.
On your local machine:
-
Install xsel (used to interact with clipboard).
-
Build the integration server (requires Go):
(cd emacs-integration && go install .) # Installs into $HOME/go/bin
-
Assuming your local machine uses systemd, copy the service and socket files into
~/.config/systemd/user
:cp *.socket *.service ~/.config/systemd/user
-
Enable systemd socket activation:
systemctl --user enable --now emacs-integration.socket
You don't have to start the service manually, as systemd can do it automatically when something conects to the port.
On your remote machine:
-
Add
reintegrate.el
to yourload-path
. -
Add to your
init.el
:(when (getenv "SSH_TTY") (require 'reintegrate) (reintegrate))
When using:
-
SSH into your remote machine and forward the ports:
ssh -R 9999:localhost:9999 myhost
-
Start Emacs.