The easiest way to do this is to use the Emacs built-in compile
command. M-x compile
should do you fine. You can then edit the command that will be run (by default make -k
) and then hit return to run the compilation. Emacs will then parse the output and if it finds any errors they will link to the source files so you can open them in a buffer.
Positives about it are:
- Parsing of the output buffer
- Memorisation of the compile command between invocations
- Compilation output is shown in a non-selected buffer, you can quickly edit the file you were working on and fix any silly errors.
M-n
andM-p
scroll by error messages
Most of these features are provided by the compilation-minor-mode
minor mode though not the actual compilation command and buffer. Once you have run a compilation command in eshell
you could probably get similar results by setting the minor mode to compilation-minor-mode
.