;;;; files for more information.
(in-package "SB!PRETTY")
-
-(file-comment
- "$Header$")
\f
;;;; pretty streams
(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
(ecase (fits-on-line-p stream (block-start-section-end next)
force-newlines-p)
((t)
- ;; Just nuke the whole logical block and make it look like one
- ;; nice long literal.
+ ;; Just nuke the whole logical block and make it look
+ ;; like one nice long literal.
(let ((end (block-start-block-end next)))
(expand-tabs stream end)
(setf tail (cdr (member end tail)))))
((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)