From affd45958f1ce5366440991630a1d9d86c42f75c Mon Sep 17 00:00:00 2001 From: Peter Feigl Date: Thu, 3 May 2012 09:28:43 +0200 Subject: [PATCH 1/6] 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. --- src/runtime/swank.scm | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/src/runtime/swank.scm b/src/runtime/swank.scm index eab8a55..ddfeee3 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))) -- 1.7.10