chiark / gitweb /
src/{module-impl,utilities}.lisp: Make `#line' work when pretty-printing.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 5 Jan 2016 16:31:09 +0000 (16:31 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 29 May 2016 13:40:40 +0000 (14:40 +0100)
commit08b6e064ab3b18bbc5a9af47418c02f0e7ebc52d
tree4131de4c1ec7a5526f196eeb4e41baacc34bcfbc
parent44929d946ed4afd2792bb1355f4bd1226bea6449
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.
doc/SYMBOLS
doc/misc.tex
src/module-impl.lisp
src/utilities.lisp