Emacs Slime mode : slime-tramp 對應遠端檔案路徑
遠端使用 swank 伺服器 在 Emacs slime-connect 連接遠端 SBCL (common lisp) 。 M-x slime-connect Host: localhost Port: 4005 Close old connections first? (y or n) y Versions differ: nil (slime) vs. 2.31 (swank). Continue? (y or n) y slime-tramp 的用途 讓 SLIME 在遠端 Lisp 回報檔案路徑時,可以自動轉換成 TRAMP 格式路徑 (像 /ssh:remote-host:/path/to/file.lisp ), 這樣 Emacs 不需要額外的 sshfs 掛載就能直接打開遠端檔案。 不需要手動維護 slime-filename-translations 的 alist,適合「只用 ssh 連線,不掛載遠端檔案」的情境。 自動路徑轉換 當 Lisp 回傳例如: #P"/home/user/project/foo.lisp" Emacs 會自動轉成: /ssh:remote-host:/home/user/project/foo.lisp 相關參數 slime-translate-from-lisp-filename-function 從 Lisp 傳回路徑 → 轉換為 Emacs 可以理解的檔案路徑。 slime-translate-to-lisp-filename-function 從 Emacs 的檔案路徑 → 轉換成 Lisp 端可以理解的路徑。 這兩個通常由 slime-filename-translations 自動設定,不需要手動修改 在 Emacs init.lisp 設定遠端檔案修改儲存 (require 'slime) (slime-setup '( slime-cl-indent ...