Tab completions on remote Emacs with SLIME

280 views Asked by At

At the SLIME repl on a remote SWANK, typing:

(open "~/

and then hitting TAB

This brings up a buffer with auto-completions on my local filesystem. Anyone know how to make it show the files on the remote system?

Currently my .emacs looks like this:

(load (expand-file-name "~/quicklisp/slime-helper.el"))
(setq inferior-lisp-program "sbcl")
(require 'slime)
(slime-setup '(slime-fancy slime-tramp slime-asdf))
(slime-require :swank-listener-hooks)
(push (slime-create-filename-translator :machine-instance "ws1"
                    :remote-host "ws1"
                    :username "myusername")
      slime-filename-translations)  

I've been googling and trying random stuff for a bit now, any help is much appreciated!

1

There are 1 answers

1
Rörd On

You would need to provide a new implementation of the function slime-maybe-complete-as-filename. Its default implementation calls the Emacs function comint-replace-by-expanded-filename.

The most universal solution to this problem would be to query the remote Lisp for file system data. It would probably be easier though to write a function that simply redirects the completion through a TRAMP connection to the remote system.