[slime-cvs] CVS slime

mkoeppe mkoeppe at common-lisp.net
Sun Dec 31 12:28:49 UTC 2006


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv1474

Modified Files:
	present.lisp 
Log Message:
(slime-stream-p): Allow sending presentations to
the repl-results stream.
(make-presentations-result): Removed.
(send-repl-results-to-emacs): New.


--- /project/slime/cvsroot/slime/present.lisp	2006/11/04 12:02:09	1.19
+++ /project/slime/cvsroot/slime/present.lisp	2006/12/31 12:28:46	1.20
@@ -96,7 +96,8 @@
 			  thereis (or (eq stream (connection.dedicated-output connection))
 				      (eq stream (connection.socket-io connection))
 				      (eq stream (connection.user-output connection))
-				      (eq stream (connection.user-io connection))))))))))
+				      (eq stream (connection.user-io connection))
+				      (eq stream (connection.repl-results connection))))))))))
 
 (defun can-present-readable-objects (&optional stream)
   (declare (ignore stream))
@@ -168,20 +169,20 @@
 	  (write-annotation stream #'presentation-end record)))
       (funcall continue)))
 
-(defun make-presentations-result (values)
+(defun send-repl-results-to-emacs (values)
   ;; Override a function in swank.lisp, so that 
   ;; nested presentations work in the REPL result.
-  (cond 
-    ((null values)
-     '(:values ()))
-    (t
-     ;; Do the output ourselves.
-     (fresh-line)
-     (dolist (o values)
-       (presenting-object o *standard-output*
-	 (prin1 o))
-       (terpri))
-     '(:suppress-output))))
+  (let ((repl-results (connection.repl-results *emacs-connection*)))
+    (flet ((send (value)
+	     (presenting-object value repl-results
+	       (prin1 value repl-results))
+	     (terpri repl-results)))
+      (if (null values)
+	  (progn 
+	    (princ "; No value" repl-results)
+	    (terpri repl-results))
+	  (mapc #'send values)))
+    (finish-output repl-results)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 




More information about the slime-cvs mailing list