Closed snogge closed 4 years ago
On second though, the ANSI codes that are not interpreted probably depends on how the input happens to be processed by the compilation process and is passed to it's input filer compilation-filter. This commit has no way to guarantee that the codes are interpreted correcvtly, it just makes them available to compilation-filter which is then free to screw it up.
Fixes #171, which reports that adding
ansi-color-apply-on-region
tocompilation-filter-hook
did not work with colorized buttercup output. This was because in thecompilation-filter
function, carriage movment characters\r
and\n
are handled (bycomint-carriage-motion? ) before
compilation-filter-hook? .It is often recommended to use
in a
compilation-filter-hook
function to handle ANSI or SGR control sequences in compilation output. But carriage motion may causepoint
to move to beforecompilation-filter-start
. Thenansi-color-apply-on-region
will miss SGR control sequences in thepoint
---compilation-filter-start
range. Usinginstead will at least avoid this problem for carriage motion that does not move point to preceding lines.