chiark / gitweb /
src/{module-impl,utilities}.lisp: Make `#line' work when pretty-printing.
The `pprint-logical-block' macro interposes a `pretty-printing stream'
between its body and the underlying stream. This makes using fancy
functionality of the underlying stream (e.g., having it keep track of
the current cursor position) rather tricky.
It would (just about) be possible to introduce a wrapper around
`pprint-logical-block' which keeps track of the mapping between
pretty-printing and plain streams; but that requires that the macro is
actually used everywhere, which is difficult because pretty-printing can
also be initiated using the `format' `~<...~:>' command.
So instead I introduce a system-specific hack `print-ugly-stuff' which
knows how to extract and expose the underlying stream to its caller, and
synchronize things so that nothing gets lost (on SBCL and CMUCL, at
least; on others, it just passes back the pretty-printing stream). The
function `output-c-excursion' now uses this to do its thing.