0.6.11.6:
[sbcl.git] / src / code / pprint.lisp
index 421fc97..b23a4dc 100644 (file)
@@ -28,7 +28,7 @@
 
 (defconstant default-line-length 80)
 
-(defstruct (pretty-stream (:include sb!sys:lisp-stream
+(defstruct (pretty-stream (:include sb!kernel:lisp-stream
                                    (:out #'pretty-out)
                                    (:sout #'pretty-sout)
                                    (:misc #'pretty-misc))
   (declare (type posn posn) (type pretty-stream stream)
           (values posn))
   (index-column (posn-index posn stream) stream))
+
+;;; Is it OK to do pretty printing on this stream at this time?
+(defun print-pretty-on-stream-p (stream)
+  (and (pretty-stream-p stream)
+       *print-pretty*))
 \f
 ;;;; stream interface routines
 
   (posn 0 :type posn))
 
 (defmacro enqueue (stream type &rest args)
-  (let ((constructor (intern (concatenate 'string
-                                         "MAKE-"
-                                         (symbol-name type)))))
+  (let ((constructor (symbolicate "MAKE-" type)))
     (once-only ((stream stream)
                (entry `(,constructor :posn
                                      (index-posn
                  ((t) *terminal-io*)
                  ((nil) *standard-output*)
                  (t stream))))
-    (when (pretty-stream-p stream)
+    (when (print-pretty-on-stream-p stream)
       (enqueue-newline stream kind)))
   nil)
 
                  ((t) *terminal-io*)
                  ((nil) *standard-output*)
                  (t stream))))
-    (when (pretty-stream-p stream)
+    (when (print-pretty-on-stream-p stream)
       (enqueue-indent stream relative-to n)))
   nil)
 
                  ((t) *terminal-io*)
                  ((nil) *standard-output*)
                  (t stream))))
-    (when (pretty-stream-p stream)
+    (when (print-pretty-on-stream-p stream)
       (enqueue-tab stream kind colnum colinc)))
   nil)