[slime-cvs] CVS slime

heller heller at common-lisp.net
Fri Nov 30 13:09:49 UTC 2007


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

Modified Files:
	swank.lisp 
Log Message:
Disable the pretty-printer for backtraces.
Would be nice if we could print newlines in strings as \n.

* swank.lisp (*backtrace-printer-bindings*):  New varaible.
(backtrace, frame-locals-for-emacs): Use it.



--- /project/slime/cvsroot/slime/swank.lisp	2007/11/29 12:35:54	1.519
+++ /project/slime/cvsroot/slime/swank.lisp	2007/11/30 13:09:49	1.520
@@ -103,9 +103,15 @@
     (*print-array*            . t)
     (*print-lines*            . 10)
     (*print-escape*           . t)
-    (*print-right-margin*     . ,most-positive-fixnum))
+    (*print-right-margin*     . 65))
   "A set of printer variables used in the debugger.")
 
+(defvar *backtrace-printer-bindings*
+  `((*print-pretty*           . nil)
+    (*print-level*            . 4)
+    (*print-length*           . 6))
+  "Pretter settings for printing backtraces.")
+
 (defvar *default-worker-thread-bindings* '()
   "An alist to initialize dynamic variables in worker threads.  
 The list has the form ((VAR . VALUE) ...).  Each variable VAR will be
@@ -2043,8 +2049,9 @@
   (loop for frame in (compute-backtrace start end)
         for i from start
         collect (list i (with-output-to-string (stream)
-                          (handler-case 
-                              (print-frame frame stream)
+                          (handler-case
+                              (with-bindings *backtrace-printer-bindings*
+                                (print-frame frame stream))
                             (t ()
                               (format stream "[error printing frame]")))))))
 
@@ -2128,11 +2135,12 @@
 (defslimefun frame-locals-for-emacs (index)
   "Return a property list ((&key NAME ID VALUE) ...) describing
 the local variables in the frame INDEX."
-  (mapcar (lambda (frame-locals)
-            (destructuring-bind (&key name id value) frame-locals
-              (list :name (prin1-to-string name) :id id
-                    :value (to-string value))))
-          (frame-locals index)))
+  (with-bindings *backtrace-printer-bindings*
+    (mapcar (lambda (frame-locals)
+              (destructuring-bind (&key name id value) frame-locals
+                (list :name (prin1-to-string name) :id id
+                      :value (to-string value))))
+            (frame-locals index))))
 
 (defslimefun frame-catch-tags-for-emacs (frame-index)
   (mapcar #'to-string (frame-catch-tags frame-index)))




More information about the slime-cvs mailing list