[slime-cvs] CVS slime

alendvai alendvai at common-lisp.net
Tue Dec 19 10:51:06 UTC 2006


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

Modified Files:
	swank.lisp 
Log Message:
Properly bind *sldb-printer-bindings* and turn off right margin while printing stuff in sldb


--- /project/slime/cvsroot/slime/swank.lisp	2006/12/19 10:47:36	1.434
+++ /project/slime/cvsroot/slime/swank.lisp	2006/12/19 10:51:03	1.435
@@ -2760,9 +2760,8 @@
         (*sldb-stepping-p* nil)
         (*swank-state-stack* (cons :swank-debugger-hook *swank-state-stack*)))
     (force-user-output)
-    (with-bindings *sldb-printer-bindings*
-      (call-with-debugging-environment
-       (lambda () (sldb-loop *sldb-level*))))))
+    (call-with-debugging-environment
+     (lambda () (sldb-loop *sldb-level*)))))
 
 (defun sldb-loop (level)
   (unwind-protect
@@ -2814,12 +2813,6 @@
 	collect (list (princ-to-string (restart-name restart))
 		      (princ-to-string restart))))
 
-(defun frame-for-emacs (n frame)
-  (let* ((label (format nil " ~2D: " n))
-         (string (with-output-to-string (stream) 
-                     (princ label stream) 
-                     (print-frame frame stream))))
-    (subseq string (length label))))
 
 ;;;;; SLDB entry points
 
@@ -2830,9 +2823,13 @@
 (defslimefun backtrace (start end)
   "Return a list ((I FRAME) ...) of frames from START to END.
 I is an integer describing and FRAME a string."
-  (loop for frame in (compute-backtrace start end)
-        for i from start
-        collect (list i (frame-for-emacs i frame))))
+  (with-bindings *sldb-printer-bindings*
+    ;; we don't want newlines in the backtrace, that makes it unreadable
+    (let ((*print-right-margin* most-positive-fixnum))
+      (loop for frame in (compute-backtrace start end)
+            for i from start
+            collect (list i (with-output-to-string (stream)
+                              (print-frame frame stream)))))))
 
 (defslimefun debugger-info-for-emacs (start end)
   "Return debugger state, with stack frames from START to END.
@@ -2865,10 +2862,11 @@
    (\"ABORT\" \"Return to Top-Level.\"))
   ((0 \"(KERNEL::INTEGER-/-INTEGER 1 0)\"))
   (4))"
-  (list (debugger-condition-for-emacs)
-	(format-restarts-for-emacs)
-	(backtrace start end)
-        *pending-continuations*))
+  (with-bindings *sldb-printer-bindings*
+    (list (debugger-condition-for-emacs)
+          (format-restarts-for-emacs)
+          (backtrace start end)
+          *pending-continuations*)))
 
 (defun nth-restart (index)
   (nth index *sldb-restarts*))




More information about the slime-cvs mailing list