DistilledProblems · 2022-12-11 07:21
Hi. I'm still fairly new to emacs, and usually I'd solve this problem myself, but I am honestly overwhelmed. When I search for emacs customizations, I'm curious how to enable flymake for basic linting, i.e. underlining forgotten semicolons i.e. Now, emacs does behave strangely if I make a syntax error (weird tabs, spacing, etc), which is a decent indicator. However, this doesnt show what the error is.
I'm asking because there's like 20 different flymake options in the customization panel.
I've tried activating flymake-mode, but doesn't seem to do anything when I write bad syntax on purpose for testing.
Illiamen · 2022-12-11 14:25
Questions to ask are:
1. Is your language one that Flymake supports? As in, does the major mode set it up? Not all do, but there are packages to add support.
2. Do you have the programs that it wants to use for linting? For example, to lint Python buffers, Flymake uses Python packages. Eglot uses Flymake to highlight errors communicated by a language server.
With the right tools installed, the support set up, and the mode enabled, Flymake will highlight/underline errors and gives a count of errors, warnings, and other items in the mode line. Descriptions are given when the cursor is over the location in question. The full list of errors and their descriptions. in can be seen via `M-x flymake-show-buffer-diagnostics` and `M-x flymake-show-project-diagnostics`.
If you haven't seen it, there is a small manual section for Flymake: https://www.gnu.org/software/emacs/manual/html_node/flymake/index.html
DistilledProblems · 2022-12-11 15:08
I use C, which FM supports supposedly
Tatrics · 2022-12-15 21:37
If you are using a Makefile, make sure you have \`check-syntax\` target in it.
Otherwise customize \`flymake-cc-command\`
See [https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/flymake-cc.el#L31](https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/flymake-cc.el#L31)
and https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/flymake-cc.el#L93