Guard against a few issues:
- Flymake errors from invalid buffer positions
- Missing variable definitions in byte-compiled backends
The fix for the first involves detecting nil
results from flymake-diag-region
and dropping these invalid diagnostics. When this happens, the macro logs an error to Flymake's log buffer. These issues would have manifested as occasional errors in the process sentinels.
The simplest fix for the second issue requires the entire flymake-quickdef
package to be loaded along with the macro. To do that, just always (require 'flymake-quickdef)
along with your backend definitions (or otherwise ensure the package is loaded before the generated backends run). To avoid cases where this might not happen, I have removed the autoload cookie from the macro definition.
This issue would probably be rare but it could occur in cases with byte-compiled backend functions where eval-when-compile
is used to load flymake-quickdef
. In particular, if flymake-quickdef
is only loaded at compile time and then the byte-compiled backend definition is loaded in a later session, the variable definitions wouldn't be loaded, causing errors.