Permalink
Browse files

Updated for the latest wire protocol, thus fixing issue #18 and break…

…ing older SLIMEs. Upgrade your SLIME now!
  • Loading branch information...
1 parent 62a02be commit 4259fddc6fc40cd5ad4bbc3782172560dae6c3e5 @ivan4th ivan4th committed Feb 21, 2012
Showing with 10 additions and 7 deletions.
  1. +4 −1 README.md
  2. +2 −2 swank-handler-tests.js
  3. +4 −4 swank-handler.js
View
@@ -61,7 +61,10 @@ then [Socket.IO](http://socket.io/):
npm install socket.io
2. Get recent [SLIME](http://common-lisp.net/project/slime/) from its CVS
-or the [git mirror](http://git.boinkor.net/gitweb/slime.git).
+or the [git mirror](http://git.boinkor.net/gitweb/slime.git). The backend
+was verified to work with SLIME 2012-02-12, it may or may not work with
+other versions, but note that breaking change in the protocol was introduced
+in SLIME 2011-11-27.
3. Make sure you have latest [js2-mode](http://code.google.com/p/js2-mode/).
Add it to your .emacs:
View
@@ -69,10 +69,10 @@ function request (str) {
}
request('(:emacs-rex (swank:connection-info) "COMMON-LISP-USER" t 1)',
- '(:return (:ok (:encoding (:coding-system "utf-8" :external-format "UTF-8") ' +
+ '(:return (:ok (:encoding (:coding-systems ("utf-8-unix")) ' +
':lisp-implementation (:name "JS" :type "JS" :version "1.5") ' +
':package (:name "NODE" :prompt "NODE") ' +
- ':pid 4242 :version "2010-11-13")) ' +
+ ':pid 4242 :version "2012-02-12")) ' +
'1)');
// currently we just ignore swank-require
View
@@ -38,7 +38,7 @@ var S = lisp.S, list = lisp.list, consp = lisp.consp, car = lisp.car, cdr = lisp
repr = lisp.repr, fromLisp = lisp.fromLisp, toLisp = lisp.toLisp;
var Completion = require("./completion").Completion;
-var DEFAULT_SLIME_VERSION = "2010-11-13";
+var DEFAULT_SLIME_VERSION = "2012-02-12";
function Handler (executive) {
this.executive = executive;
@@ -84,8 +84,8 @@ Handler.prototype.receive = function receive (message) {
r.result = toLisp(
info,
{ "pid": "N:pid",
- "encoding": { name: "encoding", spec: { "coding-system": "s:codingSystem",
- "external-format": "s:externalFormat" } },
+ "encoding": { name: "encoding",
+ spec: { "coding-systems": "@:codingSystems" } },
"package": { name: "packageSpec", spec: { name: "s", prompt: "s" } },
"lisp-implementation": {
name: "implementation",
@@ -372,7 +372,7 @@ Executive.prototype.connectionInfo = function connectionInfo (cont) {
"slimeVersion",
function (slimeVersion) {
cont({ pid: self.pid === null ? process.pid : self.pid,
- encoding: { codingSystem: "utf-8", externalFormat: "UTF-8" },
+ encoding: { codingSystems: [ "utf-8-unix" ] },
packageSpec: { name: prompt, prompt: prompt },
implementation: { type: "JS", name: "JS", version: "1.5" },
version: slimeVersion || DEFAULT_SLIME_VERSION });

0 comments on commit 4259fdd

Please sign in to comment.