[slime-cvs] CVS slime

CVS User sboukarev sboukarev at common-lisp.net
Wed Feb 2 11:12:33 UTC 2011


Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv32298

Modified Files:
	ChangeLog swank.lisp 
Log Message:
* swank.lisp (eval-in-emacs): Return unreadable results from Emacs
as an unreadable-object, not as a string.


--- /project/slime/cvsroot/slime/ChangeLog	2011/02/02 10:13:07	1.2173
+++ /project/slime/cvsroot/slime/ChangeLog	2011/02/02 11:12:33	1.2174
@@ -1,5 +1,10 @@
 2011-02-02  Stas Boukarev  <stassats at gmail.com>
 
+	* swank.lisp (eval-in-emacs): Return unreadable results from Emacs
+	as an unreadable-object, not as a string.
+
+2011-02-02  Stas Boukarev  <stassats at gmail.com>
+
 	* slime.el (slime-eval-for-lisp): Return value as a string,
 	because it can be unreadable, e.g. #<buffer foo>
 	* swank.lisp (eval-in-emacs): Prevent reader errors.
--- /project/slime/cvsroot/slime/swank.lisp	2011/02/02 10:13:07	1.737
+++ /project/slime/cvsroot/slime/swank.lisp	2011/02/02 11:12:33	1.738
@@ -1818,6 +1818,14 @@
     (number (let ((*print-base* 10))
               (princ-to-string form)))))
 
+(defstruct (unreadable-object
+             (:print-object
+              (lambda (object stream)
+                (print-unreadable-object (object stream :type t :identity t)
+                  (princ (unreadable-object-string object)
+                         stream)))))
+  string)
+
 (defun eval-in-emacs (form &optional nowait)
   "Eval FORM in Emacs.
 `slime-enable-evaluate-in-emacs' should be set to T on the Emacs side."
@@ -1832,7 +1840,7 @@
 	     (destructure-case value
 	       ((:ok value)
                 (handler-case (values (read-from-string value))
-                  (reader-error () value)))
+                  (reader-error () (make-unreadable-object :string value))))
 	       ((:abort) (abort))))))))
 
 (defvar *swank-wire-protocol-version* nil





More information about the slime-cvs mailing list