Next: , Up: Backend functions

2.2.1 Flymake utility functions

Before delivering them to Flymake, backends create diagnostic objects by calling the function flymake-make-diagnostic.

— Function: flymake-make-diagnostic buffer beg end type text

Make a Flymake diagnostic for buffer's region from beg to end. type is a key to flymake-diagnostic-types-alist and text is a description of the problem detected in this region.

These objects' properties can be accessed with the functions flymake-diagnostic-backend, flymake-diagnostic-buffer, flymake-diagnostic-text, flymake-diagnostic-beg, flymake-diagnostic-end and flymake-diagnostic-type.

Additionally, the function flymake-diagnostics will collect such objects in the region you specify.

— Function: flymake-diagnostics beg end

Get a list of Flymake diagnostics in the region determined by beg and end. If neither beg or end is supplied, use the whole buffer, otherwise if beg is non-nil and end is nil, consider only diagnostics at beg.

It is often the case with external syntax tools that a diagnostic's position is reported in terms of a line number, and sometimes a column number. To convert this information into a buffer position, backends can use the following function:

— Function: flymake-diag-region buffer line &optional col

Compute buffer's region (beg . end) corresponding to line and col. If col is nil, return a region just for line. Return nil if the region is invalid.

For troubleshooting purposes, backends may record arbitrary exceptional or erroneous situations into the Flymake log buffer (see Backend exceptions):

— Macro: flymake-log level msg &optional args

Log, at level level, the message msg formatted with args. level is passed to display-warning (see Warning Basics), which is used to display the warning in Flymake's log buffer.