[slime-cvs] CVS slime

heller heller at common-lisp.net
Fri Aug 22 21:15:13 UTC 2008


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

Modified Files:
	ChangeLog swank.lisp 
Log Message:
In backtraces, escape newlines in strings as \n.

* swank.lisp (*backtrace-pprint-dispatch-table*): New.
(*backtrace-printer-bindings*): Use it.

--- /project/slime/cvsroot/slime/ChangeLog	2008/08/22 21:15:07	1.1468
+++ /project/slime/cvsroot/slime/ChangeLog	2008/08/22 21:15:12	1.1469
@@ -1,3 +1,10 @@
+2008-08-22  Helmut Eller  <heller at common-lisp.net>
+
+	In backtraces, escape newlines in strings as \n.
+
+	* swank.lisp (*backtrace-pprint-dispatch-table*): New.
+	(*backtrace-printer-bindings*): Use it.
+
 2008-08-22  Stas Boukarev <stassats at gmail.com>
 
 	* metering.lisp: Add deftypes for time-type and cons-type, which
--- /project/slime/cvsroot/slime/swank.lisp	2008/08/22 21:14:52	1.573
+++ /project/slime/cvsroot/slime/swank.lisp	2008/08/22 21:15:13	1.574
@@ -109,10 +109,28 @@
     (*print-right-margin*     . 65))
   "A set of printer variables used in the debugger.")
 
+(defvar *backtrace-pprint-dispatch-table*
+  (let ((table (copy-pprint-dispatch nil)))
+    (flet ((escape-string (stream string)
+             (write-char #\" stream)
+             (loop for c across string do
+                   (case c
+                     (#\" (write-string "\\\"" stream))
+                     (#\newline (write-string "\\n" stream))
+                     (#\return (write-string "\\r" stream))
+                     (t (write-char c stream))))
+             (write-char #\" stream)))
+      (set-pprint-dispatch 'string  #'escape-string 0 table)
+      table)))
+
 (defvar *backtrace-printer-bindings*
-  `((*print-pretty*           . nil)
+  `((*print-pretty*           . t)
+    (*print-readably*         . nil)
     (*print-level*            . 4)
-    (*print-length*           . 6))
+    (*print-length*           . 6)
+    (*print-lines*            . 1)
+    (*print-right-margin*     . 200)
+    (*print-pprint-dispatch*  . ,*backtrace-pprint-dispatch-table*))
   "Pretter settings for printing backtraces.")
 
 (defvar *default-worker-thread-bindings* '()




More information about the slime-cvs mailing list