So I'm trying to get slime and sbcl working together happily. Versions: SBCL 0.8.5.50 (CVS as of 2003/11/23) Slime (CVS as of 2003/11/23)
In order to get slime to work properly, I needed to make two minor modifications to swank-sbcl.lisp and swank.lisp.
The change to swank-sbcl.lisp was to allow SLIME-EDIT-FDEFINITION to work properly. The pathname returned by SWANK:FUNCTION-SOURCE-LOCATION hadn't been resolved via sbcl's LOGICAL-PATHNAME-TRANSLATIONS. Hence, Emacs was sending me to buffers like "SYS:SRC;CODE;DEFMACRO.LISP", rather than "/opt/cvs-trees/sbcl/src/code/defmacro.lisp". Not knowing whether this is even vaguely correct, I added a TRUENAME call as below:
Index: swank-sbcl.lisp =================================================================== RCS file: /project/slime/cvsroot/slime/swank-sbcl.lisp,v retrieving revision 1.26 diff -u -r1.26 swank-sbcl.lisp --- swank-sbcl.lisp 23 Nov 2003 14:16:42 -0000 1.26 +++ swank-sbcl.lisp 23 Nov 2003 17:40:11 -0000 @@ -324,7 +324,7 @@ (pathname (sb-introspect:definition-source-pathname def)) (path (sb-introspect:definition-source-form-path def))) (list :sbcl - :filename (and pathname (namestring pathname)) + :filename (and pathname (namestring (truename pathname))) :position (sb-introspect:definition-source-character-offset def) :path path ;; source-paths depend on the file having been compiled with
The second problem was rather more severe, since swank-sbcl.lisp doesn't define SWANK:EVAL-IN-FRAME, there was a compilation reader error on compiling swank.lisp, specifically:
| compilation aborted because of input error: | READ failure in COMPILE-FILE: | READER-ERROR at 8809 (line 270, column 41) on | #<FILE-STREAM for "file "/opt/cvs-trees/slime/swank.lisp"" {9AFF329}>: | The symbol "EVAL-IN-FRAME" is not external in the SWANK package.
Further, once the slime startup process was almost finished, it entered an infinite loop, which, when interrupted, printed the following error message in *inferior-lisp* buffer:
| ;; Connection to Emacs lost. | ;; [READER-ERROR at 18 (line 1, column 18) on #<SB-IMPL::STRING-INPUT-STREAM | {9D591E9}>: | Symbol "EVAL-STRING" not found in the SWANK package.]
The Elisp debugger output on C-g was:
| Debugger entered--Lisp error: (quit) | (eq (slime-state-name (slime-current-state)) | (quote slime-evaluating-state)) | slime-busy-p() | (while (slime-busy-p) (accept-process-output)) | (let ((debug-on-quit t) (inhibit-quit nil)) | (while (slime-busy-p) (accept-process-output))) | slime-do-eval((swank:getpid) nil (:catch-tag slime-result-76376))
I fixed this by making this modification to swank.lisp:
Index: swank.lisp =================================================================== RCS file: /project/slime/cvsroot/slime/swank.lisp,v retrieving revision 1.64 diff -u -r1.64 swank.lisp --- swank.lisp 23 Nov 2003 14:16:42 -0000 1.64 +++ swank.lisp 23 Nov 2003 17:46:07 -0000 @@ -267,7 +267,7 @@ (continue *swank-debugger-condition*))
(defslimefun eval-string-in-frame (string index) - (to-string (swank-backend:eval-in-frame (from-string string) index))) + (to-string (swank-backend::eval-in-frame (from-string string) index)))
;;;; Evaluation
Whilst this is probably not at all correct, "it works for me".