From: Peter Feigl Date: Thu, 3 May 2012 07:28:43 +0000 (+0200) Subject: Updating swank.scm to work with current slime-cvs X-Git-Tag: release-9.2.0~243^2~5 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=7a1885afa3e8da813390b7a10637402cb272b016;p=mit-scheme.git Updating swank.scm to work with current slime-cvs * Startup Problems [when using Emacs setting (slime-setup '(slime-fancy))] - M-x slime raises condition "Unbound variable: swank:swank-require" => 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. --- diff --git a/src/runtime/swank.scm b/src/runtime/swank.scm index eab8a55dd..ddfeee3f8 100644 --- a/src/runtime/swank.scm +++ b/src/runtime/swank.scm @@ -211,7 +211,7 @@ USA. (define (emacs-rex socket sexp pstring) (fluid-let ((*buffer-pstring* pstring)) - (eval (cons* (car sexp) socket (cdr sexp)) + (eval (cons* (car sexp) socket (map quote-special (cdr sexp))) swank-env))) (define *buffer-pstring*) @@ -420,7 +420,19 @@ USA. :lisp-implementation (:type "MIT/GNU Scheme" :version ,(get-subsystem-version-string "release")) - :version "20100404"))) + :version "2012-05-02" + :encoding + (:coding-systems + ("utf-8-unix" "iso-latin-1-unix"))))) + +(define (swank:swank-require socket packages) + socket + packages + '()) + +(define (swank:autodoc socket expr . params) + socket params + (list ':not-available 't)) (define (swank:quit-lisp socket) socket @@ -952,9 +964,6 @@ swank:xref (define (elisp-false? o) (or (null? o) (eq? o 'NIL))) (define (elisp-true? o) (not (elisp-false? o))) -(define nil '()) -(define t 'T) - (define (->line o) (let ((r (write-to-string o 100))) (if (car r) @@ -970,4 +979,18 @@ swank:xref (fluid-let ((*unparser-list-breadth-limit* 10) (*unparser-list-depth-limit* 4) (*unparser-string-length-limit* 100)) - (pp o p))))) \ No newline at end of file + (pp o p))))) + +;; quote keywords, t and nil +(define (quote-special x) + (cond ((and (symbol? x) + (or + (and (> (string-length (symbol->string x)) 0) + (char=? #\: (string-ref (symbol->string x) 0))) + (eq? x 't))) + `(quote ,x)) + ((and (symbol? x) + (eq? x 'nil)) + '()) + (else + x)))