A version of Swank for MIT/GNU Scheme that works with current SLIME CVS.
Keywords: swank mit-scheme slime
(load-option 'format) (load "/path/to/new/swank.scm" (->environment '(runtime swank)))
somewhere into your
runtime/swank.scm in your MIT/GNU Scheme source directory with this
swank.scm before building it, but remove the last line (because
(initialize-package!) is run automatically in that case).
The following fixes were applied to MIT/GNU Scheme swank.scm (git)
- M-x slime raises condition “Unbound variable: swank:swank-require” (which Emacs sends when (slime-setup ‘(slime-fancy)) is used) => fixed by defining swank:swank-require to return ‘()
- M-x slime shows “error in process filter: Can’t find suitable coding-system” => fixed by adding :encoding (:coding-systems (“utf-8-unix” “iso-latin-1-unix”)) to the connection info
- M-x slime raises condition “Unbound variable :conding-system” (which is due to all parameters being evaluated) => fixed by adding QUOTE-SPECIAL and mapping it over the parameters (quoting all keywords [symbols that start with a colon] and T and NIL)
- Typing an expression raises condition “Unbound variable: swank:autodoc” => fixed by defining swank:autodoc to return (list ‘:not-available ‘t)
- Slime complains about mismatched versions => fixed by changing :version in swank:connection-info to “2012-05-02” which matches slime-cvs
Now we have a working SLIME REPL again.
Actually implement swank:autodoc. It is called with a list form that contains the special symbol swank::%cursor-marker% somewhere to show the position of the cursor. The new procedure FIND-STRING-BEFORE-SWANK-CURSOR-MARKER returns the symbol that starts the expression which contains the cursor as a string. The new procedure PROCEDURE-PARAMETERS returns a list containing the function name and the list of parameters (as printed by PA) if symbol is bound to a function. The new variable SWANK-EXTRA-DOCUMENTATION contains an (incomplete) list of “parameters” to special forms and macros.
Now we have working autodoc in the REPL and in Scheme buffers.
Trying to auto-complete in the REPL raises condition “Unbound variable: swank:completions”. It seems swank added swank:completions in addition (or instead of?) swank:simple-completions.
Added directory functions SWANK:DEFAULT-DIRECTORY and SWANK:SET-DEFAULT-DIRECTORY for slime commands ,!d ,cd ,+d ,-d ,change-directory ,push-directory ,pop-directory ,pushd ,popd ,pwd
There are numerous problems, including no replies sent to messages and incorrect replies.
- Added condition/report-string to the abort message.
- Added a DYNAMIC-WIND in the condition handler in the message handler for emacs-rex to ensure that the :abort message is always written, even when a restart is called.
- Added a global (fluid) binding index that is used to send the correct message index in the :debug message.
Adding basic support for SWANK:DESCRIBE-FUNCTION and SWANK:DESCRIBE-SYMBOL.
The returned lists are formatted incorrectly (not Lisp proplists). Fixed this.
The binding for compile-and-load is missing. Not implemented yet.
Added support for “presentations”. Every result is clickable in Emacs, which recalls the value.
Added buffering of output before sending to Emacs. Without this, SLIME is not usable for programs that write more than a few lines of output.
Working on debugging, added redirection of input (as well as output) to Emacs, though this doesn’t work yet for restarts that need input (like USE-VALUE).