[slime-cvs] CVS slime

mkoeppe mkoeppe at common-lisp.net
Fri Dec 29 16:10:26 UTC 2006


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

Modified Files:
	swank.lisp 
Log Message:
(make-presentations-result): Removed.
(send-repl-results-to-emacs): New function, sends :WRITE-STRING events.
(listener-eval): Use it here instead of make-presentations-result.


--- /project/slime/cvsroot/slime/swank.lisp	2006/12/24 13:44:11	1.443
+++ /project/slime/cvsroot/slime/swank.lisp	2006/12/29 16:10:26	1.444
@@ -2637,11 +2637,17 @@
   (let ((p (setq *package* (guess-package-from-string package))))
     (list (package-name p) (package-string-for-prompt p))))
 
-(defun make-presentations-result (values)
-  ;; overridden in present.lisp
-  `(:present ,(loop for x in values 
-                    collect (cons (prin1-to-string x) 
-                                  (save-presented-object x)))))
+(defun send-repl-results-to-emacs (values)
+  (flet ((send (value)
+           (let ((id (and *record-repl-results*
+                          (save-presented-object value))))
+             (send-to-emacs `(:write-string ,(prin1-to-string value)
+                              ,id :repl-result))
+             (send-to-emacs `(:write-string ,(string #\Newline) 
+                              nil :repl-result)))))
+    (if (null values)
+        (send-to-emacs `(:write-string "; No value" nil :repl-result))
+        (mapc #'send values))))
 
 (defslimefun listener-eval (string)
   (clear-user-input)
@@ -2654,11 +2660,9 @@
 	  (setq *** **  ** *  * (car values)
 		/// //  // /  / values))
 	(setq +++ ++  ++ +  + last-form)
-        (cond ((eq *slime-repl-suppress-output* t) '(:suppress-output))
-              (*record-repl-results*
-               (make-presentations-result values))
-              (t 
-               `(:values ,(mapcar #'prin1-to-string values))))))))
+        (unless (eq *slime-repl-suppress-output* t)
+          (send-repl-results-to-emacs values)))))
+  nil)
 
 (defslimefun ed-in-emacs (&optional what)
   "Edit WHAT in Emacs.




More information about the slime-cvs mailing list