[slime-cvs] CVS slime

alendvai alendvai at common-lisp.net
Tue Dec 19 10:55:24 UTC 2006


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

Modified Files:
	slime.el 
Log Message:
Fix slime-insert-presentation to handle multi-line presentations better (use insert-rectangle)


--- /project/slime/cvsroot/slime/slime.el	2006/12/19 10:49:43	1.718
+++ /project/slime/cvsroot/slime/slime.el	2006/12/19 10:55:24	1.719
@@ -3015,13 +3015,24 @@
         (delete-overlay overlay)))))
 
 (defun slime-insert-presentation (string output-id)
-  (cond ((not slime-repl-enable-presentations)
-         (insert string))
-        (t
-         (let ((start (point)))
-           (insert string)
-           (slime-add-presentation-properties start (point) output-id t)))))
-                          
+  (flet ((insert-it ()
+           (let ((lines (split-string string "\n")))
+             (if (cdr lines)
+                 (progn
+                   (save-excursion
+                     (dolist (line lines)
+                       (newline)))
+                   (insert-rectangle lines)
+                   (forward-char)
+                   (delete-backward-char 1))
+                 (insert string)))))
+    (cond ((not slime-repl-enable-presentations)
+           (insert-it))
+          (t
+           (let ((start (point)))
+             (insert-it)
+             (slime-add-presentation-properties start (point) output-id t))))))
+
 (defun slime-open-stream-to-lisp (port)
   (let ((stream (open-network-stream "*lisp-output-stream*" 
                                      (slime-with-connection-buffer ()
@@ -8691,7 +8702,7 @@
             (slime-insert-presentation
              (in-sldb-face local-value value)
              `(:frame-var ,frame ,i)))
-          (insert "\n"))))
+          (newline))))
 
 (defun sldb-inspect-var ()
   (let ((frame (sldb-frame-number-at-point))




More information about the slime-cvs mailing list