XEmacs + TRAMP = remote editing (= awesome)
2007-12-11 / 04:43 / dave
XEmacs 21 comes pre-installed with TRAMP (Transparent Remote (file) Access, Multiple Protocol). As soon as you learn the naming convention, you can edit remote files just as easily as local files (well, as long as you don’t mind the 5 second start-up time). It’s as simple as
Find file: /[dgingrich@bam.dreamhost.com].bashrc
In the background, TRAMP opens a remote connection and either copies the remote file to a local temp directory (with something like scp) or mime encodes the remote file and streams it.
Despite the “careful! beta!” warnings in the documentation, the authors evidently took time making things “just work”. The handling of encoding for streaming is especially cool: it tries to use mimencode, falls back to uuencode and finally tries sending the remote host a snippet of perl code. A neat example of a dynamic programming mind-set: the real world is messy, so test and fall-back. The ultimate fall-back is the 7 bajillion configuration options, including ones for windows and old versions of ssh.
For me it just worked. The totality of my configuration was a single line in my .xemacs/custom.el:
(setq tramp-default-method "sshx")
The only hang-up I had was trying to use the emacs syntax (/dgingrich@bam.dreamhost.com:.bashrc) which is unfortunately used by the EFS package. So instead of getting a secure SSH connect, it tried to set-up an FTP connection. I aborted before putting in my precious precious password, but it was confusing that it “worked” but not with the protocol I expected. It turns out that this was a limitation of XEmacs setup. Ah well, no harm no foul.
Cherry on top? It works just fine with ssh-agent. So as long as I start XEmacs from a bash-ssh it’s a password-less experience.
