0

When compiling, how can I remove all output in the *compilation* buffer except output issued by my code itself?

i.e. remove everything except the line(s) marked *** below:

-*- mode: compilation; default directory: ... -*-
Compilation started at ...

make -f ...
make: Entering directory ...
echo hello world
hello world ***
make: Leaving directory ...

Compilation finished at ...
jessexknight
  • 103
  • 3
  • There is no provision to do that. Emacs only adds the first two lines and the last line. The stuff in between is produced by whatever shell command is called from `compile`. Emacs just takes the whole output and sticks it into the buffer. It does do some post-processing but only to make it easier for you to figure out what your mistakes were - see the doc string of the function `next-error` with `(C-h f next-error`). Read the chapter "Compiling and Testing Programs" in the Emacs manual (which you can get to with `C-h i g(emacs)mBuilding`). – NickD Jul 23 '22 at 01:24
  • Thanks. That's surprising to me, and annoying. I just want to isolate my output to quickly see them. I am migrating from Atom ([RIP](https://github.blog/2022-06-08-sunsetting-atom/)) where I was using makefiles with [build-make](https://github.com/AtomBuild/atom-build-make) to organize various tasks. But I guess I will look for better suited tool in the emacsphere.. – jessexknight Jul 23 '22 at 01:45

0 Answers0