简体   繁体   English

使用SLIME在远程Emacs上完成选项卡

[英]Tab completions on remote Emacs with SLIME

At the SLIME repl on a remote SWANK, typing: 在远程SWANK上的SLIME repl上,键入:

(open "~/ (打开“〜/

and then hitting TAB 然后点击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: 目前我的.emacs看起来像这样:

(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! 我一直在谷歌搜索和尝试随机的东西,任何帮助非常感谢!

You would need to provide a new implementation of the function slime-maybe-complete-as-filename . 您需要提供函数slime-maybe-complete-as-filename的新实现。 Its default implementation calls the Emacs function comint-replace-by-expanded-filename . 它的默认实现调用Emacs函数comint-replace-by-expanded-filename

The most universal solution to this problem would be to query the remote Lisp for file system data. 解决此问题的最普遍的解决方案是查询远程Lisp以获取文件系统数据。 It would probably be easier though to write a function that simply redirects the completion through a TRAMP connection to the remote system. 虽然编写一个简单地通过TRAMP连接将完成重定向到远程系统的功能可能会更容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM