Hello.<br><br>I'm using swank for a school project, so that, in Emacs, I can use Common Lisp to do database related operations. The thing is that Emacs Lisp doesn't have any good package to do database operations (DDL and DML API, socket connection to a database, ACID properties, etc). I've used, as a first try, sql-mode to fire a mysql client process and did all sql operations from there. However it doesn't support some desired properties (rollbacks, etc), the program would be strongly tied to the specific output of mysql client process (I had to parse the output to get the results) and it was a nightmare to make the select queries synchronous (the function would receive a select query string and block while the mysql process outputs the result - and then parse).
<br><br>I chosed CL-SQL as a engine to do DB related operations, and now I need a way to comunicate between Emacs and Common Lisp. I don't know if it is the best way to do it, but I'm using swank as the "bridge" between both.
<br><br>However I don't know, neither can't find documented, the protocol to communicate with swank. Can you help me?<br><br><br><br><br>Thats all I did until now:<br><br>I've fired swank in a SBCL console:<br><br>(require 'swank)
<br>(swank::create-swank-server 4006 :spawn #'swank::simple-announce-function t)<br><br>And then I connect in Emacs:<br><br>(open-network-stream "swank-process" "swank-buffer" "localhost" 4006)
<br><br>I find "swank-buffer" which reads:<br><br>000025(:open-dedicated-output-stream 46912)<br><br>Then I connect to 46912:<br><br>(open-network-stream "swank-output" "swank-output-buffer" "localhost" 46912)
<br><br>However as I try to communicate with "swank-process", using (process-send-string), the connection exits abnormally with code 256. In the SBCL console it shows:<br><br>;; Swank started at port: 4006.<br><br>
4006<br>* ;; Event history start:<br>WRITE: (:open-dedicated-output-stream 46912)<br>;; Event history end.<br>;; Connection to Emacs lost. [<br>;;  condition: junk in string "(+ 2 2"<br>;;  type: SWANK::SLIME-PROTOCOL-ERROR
<br>;;  encoding: :ISO-LATIN-1-UNIX style: :SPAWN dedicated: T]<br><br>debugger invoked on a SIMPLE-ERROR in thread<br>#<THREAD "auto-flush-thread" {B096EE1}>:<br>  #<SB-SYS:FD-STREAM for "a constant string" {AF7E3A9}> is closed.
<br><br>