How to highlight a source in Emacs compile mode when a compilation error occurs

I have read the documentation about compile mode but I have not found any technique for hightlight source code where compilation error occurs.

For example, change the background color of the source code that generates a compile error (like red underline in Eclipse or Netbeans). And also a way to read the error message somewhere.

+2


source to share


2 answers


Usually compile mode will highlight the error message in the compiler output, and you can use it to jump to the code. If you want your code syntax checked / highlighted, you can look at flymake , which is supposed to be able to do just that.



+4


source


This option next-error-highlight

controls the highlighting of compilation and grep hits in the source buffers. The possibilities for this are as follows:

  • highlight for a given time or until the next command
  • highlight until next command or until next visit press
  • do not highlight
  • show location in fringe - which indication moves with locus

If you are using a library simple+.el

, you have one more option: highlight as long as the locus is moving. It highlights like the first two possibilities above, but the highlight doesn't fade - it just moves like the last opportunity above (fringe).



This looks like what you want. (This is what I'm using.) For example, for the grep

corresponding text is highlighted in the source file at the location you are visiting. It stays highlighted until you visit another hit.

The same is true for a similar option next-error-highlight-no-select

.

Also, for grep

and compiling to evaluate the new value provided simple+.el

, you will also need the libraries grep+.el

and compile+.el

, respectively.

+1


source







All Articles