Flymake: improve idempotence of flymake-mode (bug#69809)
In some circumstances, such as the ones described in the referenced bug
report, flymake-mode is activated non-interactively and asynchronously
in buffers where it may already be active and in the midst of
operations.
This commit ensures that flymake-mode a bit safer to re-enable in such
circumstances and fixes the bug. It also adds some comments documenting
the situation.
* lisp/progmodes/flymake.el (flymake-mode): Don't smash flymake--state.
Add some comments. No need to check for flymake--state nil.
(flymake--project-diagnostics): No need to check for flymake--state nil.
(cherry picked from commit
3a1b36a39dcd5a860a91a403f96721109203934a)