3

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!

gaauto
  • 43
  • 2
  • I don't think this is SLIME's autocompletion at work. Would you happen to have `auto-complete` or similar package installed? Or could be it's just the way Emacs completes it based on the same prefix used in other buffers? –  Sep 07 '13 at 12:24
  • @wvxvw No auto-complete installed, though I have been meaning to try it out - looks very cool. – gaauto Sep 07 '13 at 18:25

1 Answers1

1

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.

Rörd
  • 6,556
  • 21
  • 27
  • Good answer @Rörd. After looking through comint.el, slime.el, as well as tramp-sh.el (since remote completion works there) - I need to learn more elisp before I can tackle something like this. – gaauto Sep 07 '13 at 18:45