Alan Ruttenberg alanr-l@mumble.net writes:
Just wanted to point out that pretty printing isn't the only use case. It isn't the primary use in my work.
I agree, but pretty printing is often enabled by default, and it is not nice if the layout (for instance that of DESCRIBE) is messed up.
Also, again, I haven't looked closely, but can the annotation approach you used solve this problem?
I use annotations to make presentations work within pretty printing streams (of CMUCL, SBCL, and Allegro CL). Unfortunately, annotations do not help outside of pretty printing streams: Consider (LET ((*PRINT-PRETTY* T)) (FORMAT STREAM "~&~A ~A~%" OBJECT1 OBJECT2)). Here two pp streams are created in sequence. After OBJECT1 has been printed, the pretty printing stream for OBJECT2 bases its layout decisions on the character position of STREAM. Presentation escape sequences used for printing OBJECT1 will therefore influence the layout of OBJECT2. Unfortunately, at least in CMUCL and SBCL when STREAM is a (built-in) Lisp stream, there is no way to influence the character position, to correct it for the escape sequences.