I am using Emacs 26.3 on Ubuntu 20.04. When I run a command (say, clang) through the (compile ...) function, colors that should have been visible in the output *compilation* buffer are not made visible until I manually switch over to that buffer (move my cursor into it).

This only happens for text that would have been colored by Emacs (e.g., compilation errors, file names, green "finished" message, etc.). If I manually try to emit some text with ANSI color codes, those colors show up immediately with the text.

I tried to solve this problem by trying to run (font-lock-fontify-buffer), but it doesn't take a buffer name as an argument.

Any idea why this might be happening, and what would be the right way to solve it?

  • Can you post a step-by-step recipe, starting from emacs -Q, to repro the problem? That will likely help others understand and help you better.
    – Drew
    Mar 15 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.