Flymake is amazing. See the screenshot:

What you need is only a Makefile with an extra target "check-syntax":
check-syntax:
gcc -o nul -Wall -Wextra -fsyntax-only $(CHK_SOURCES)
And of course type "M-x flymake-mode" when needed.
You can also customize the error and warning face in .emacs like:
(require 'flymake nil t)
(when (featurep 'flymake)
(set-face-background 'flymake-errline "LightPink")
(set-face-foreground 'flymake-errline "DarkRed")
(set-face-bold-p 'flymake-errline t)
(set-face-background 'flymake-warnline "LightBlue2")
(set-face-foreground 'flymake-warnline "DarkBlue")
(set-face-bold-p 'flymake-warnline t))
No comments:
Post a Comment