File: flymake.el.html

Flymake is a minor Emacs mode performing on-the-fly syntax checks.

Flymake collects diagnostic information for multiple sources, called backends, and visually annotates the relevant portions in the buffer.

This file contains the UI for displaying and interacting with the results produced by these backends, as well as entry points for backends to hook on to.

The main interactive entry point is the flymake-mode(var)/flymake-mode(fun) minor mode, which periodically and automatically initiates checks as the user is editing the buffer. The variables flymake-no-changes-timeout, flymake-start-on-flymake-mode give finer control over the events
triggering a check, as does the interactive command flymake-start,
which immediately starts a check.

Shortly after each check, a summary of collected diagnostics should appear in the mode-line. If it doesn't, there might not be a suitable Flymake backend for the current buffer's major mode, in which case Flymake will indicate this in the mode-line. The indicator will be ! (exclamation mark), if all the configured backends errored (or decided to disable themselves) and ?
(question mark) if no backends were even configured.

For programmers interested in writing a new Flymake backend, the docstring of flymake-diagnostic-functions, the Flymake manual, and the code of existing backends are probably a good starting point.

The user wishing to customize the appearance of error types should set properties on the symbols associated with each diagnostic type. The standard diagnostic symbols are :error, :warning and
:note (though a specific backend may define and use more). The
following properties can be set:

* flymake-bitmap, an image displayed in the fringe according to
flymake-fringe-indicator-position. The value actually follows the syntax of flymake-error-bitmap (which see). It is overridden by any before-string overlay property.

* flymake-severity, a non-negative integer specifying the
diagnostic's severity. The higher, the more serious. If the overlay property priority is not specified, severity is used to set it and help sort overlapping overlays.

* flymake-overlay-control, an alist ((OVPROP . VALUE) ...) of
further properties used to affect the appearance of Flymake annotations. With the exception of category and evaporate, these properties are applied directly to the created overlay. See Info Node (elisp)Overlay Properties.

* flymake-category, a symbol whose property list is considered a
default for missing values of any other properties. This is useful to backend authors when creating new diagnostic types that differ from an existing type by only a few properties. The category symbols flymake-error, flymake-warning and flymake-note make good candidates for values of this property.

For instance, to omit the fringe bitmap displayed for the standard
:note type, set its flymake-bitmap property to nil:

  (put :note 'flymake-bitmap nil)

To change the face for :note type, add a face entry to its flymake-overlay-control property.

  (push '(face . highlight) (get :note 'flymake-overlay-control))

If you push another alist entry in front, it overrides the previous one. So this effectively removes the face from :note diagnostics.

  (push '(face . nil) (get :note 'flymake-overlay-control))

To erase customizations and go back to the original look for
:note types:

  (cl-remf (symbol-plist :note) 'flymake-overlay-control) (cl-remf (symbol-plist :note) 'flymake-bitmap)

Defined variables (35)

flymake--recent-changesRecent changes collected by ‘flymake-after-change-function’.
flymake--stateState of a buffer’s multiple Flymake backends.
flymake-check-start-timeTime at which syntax check was started.
flymake-diagnostic-functionsSpecial hook of Flymake backends that check a buffer.
flymake-diagnostics-buffer-mode-abbrev-tableAbbrev table for ‘flymake-diagnostics-buffer-mode’.
flymake-diagnostics-buffer-mode-hookHook run after entering Flymake diagnostics mode.
flymake-diagnostics-buffer-mode-mapKeymap for ‘flymake-diagnostics-buffer-mode’.
flymake-diagnostics-buffer-mode-syntax-tableSyntax table for ‘flymake-diagnostics-buffer-mode’.
flymake-error-bitmapBitmap (a symbol) used in the fringe for indicating errors.
flymake-fringe-indicator-positionThe position to put Flymake fringe indicator.
flymake-gui-warnings-enabledEnables/disables GUI warnings.
flymake-list-only-diagnosticsDiagnostics list meant for listing, not highlighting.
flymake-log-levelObsolete and ignored variable.
flymake-menuFlymake menu.
flymake-modeNon-nil if Flymake mode is enabled.
flymake-mode-hookHook run after entering or leaving ‘flymake-mode’.
flymake-mode-line-counter-formatMode-line construct for formatting Flymake diagnostic counters.
flymake-mode-line-countersMode-line construct for counting Flymake diagnostics.
flymake-mode-line-exceptionMode-line construct to report on exceptional Flymake status.
flymake-mode-line-formatMode line construct for customizing Flymake information.
flymake-mode-line-titleMode-line construct to show Flymake’s mode name and menu.
flymake-mode-mapKeymap for ‘flymake-mode’.
flymake-no-changes-timeoutTime to wait after last change before automatically checking buffer.
flymake-note-bitmapBitmap (a symbol) used in the fringe for indicating info notes.
flymake-project-diagnostics-mode-abbrev-tableAbbrev table for ‘flymake-project-diagnostics-mode’.
flymake-project-diagnostics-mode-hookHook run after entering Flymake diagnostics mode.
flymake-project-diagnostics-mode-mapKeymap for ‘flymake-project-diagnostics-mode’.
flymake-project-diagnostics-mode-syntax-tableSyntax table for ‘flymake-project-diagnostics-mode’.
flymake-start-on-flymake-modeIf non-nil, start syntax check when ‘flymake-mode’ is enabled.
flymake-start-on-save-bufferIf non-nil, start syntax check when a buffer is saved.
flymake-start-syntax-check-on-find-fileIf non-nil, start syntax check when ‘flymake-mode’ is enabled.
flymake-suppress-zero-countersControl appearance of zero-valued diagnostic counters in mode line.
flymake-timerTimer for starting syntax check.
flymake-warning-bitmapBitmap (a symbol) used in the fringe for indicating warnings.
flymake-wrap-aroundIf non-nil, moving to errors wraps around buffer boundaries.

Defined functions (101)

copy-flymake--diag(ARG)
copy-flymake--state(ARG)
flymake--clear-foreign-diags(STATE)
flymake--collect(FN &optional MESSAGE-PREFIX)
flymake--diag-accessor(PUBLIC INTERNAL THING)
flymake--diag-backend(CL-X)
flymake--diag-backend--cmacro(CL-WHOLE-ARG CL-X)
flymake--diag-beg(CL-X)
flymake--diag-beg--cmacro(CL-WHOLE-ARG CL-X)
flymake--diag-data(CL-X)
flymake--diag-data--cmacro(CL-WHOLE-ARG CL-X)
flymake--diag-end(CL-X)
flymake--diag-end--cmacro(CL-WHOLE-ARG CL-X)
flymake--diag-locus(CL-X)
flymake--diag-locus--cmacro(CL-WHOLE-ARG CL-X)
flymake--diag-make
flymake--diag-make--cmacro
flymake--diag-orig-beg(CL-X)
flymake--diag-orig-beg--cmacro(CL-WHOLE-ARG CL-X)
flymake--diag-orig-end(CL-X)
flymake--diag-orig-end--cmacro(CL-WHOLE-ARG CL-X)
flymake--diag-overlay(CL-X)
flymake--diag-overlay--cmacro(CL-WHOLE-ARG CL-X)
flymake--diag-overlay-properties(CL-X)
flymake--diag-overlay-properties--cmacro(CL-WHOLE-ARG CL-X)
flymake--diag-p(CL-X)
flymake--diag-p--cmacro(CL-WHOLE-ARG CL-X)
flymake--diag-text(CL-X)
flymake--diag-text--cmacro(CL-WHOLE-ARG CL-X)
flymake--diag-type(CL-X)
flymake--diag-type--cmacro(CL-WHOLE-ARG CL-X)
flymake--diagnostics-buffer-entries()
flymake--disable-backend(BACKEND &optional EXPLANATION)
flymake--equal-diagnostic-p(A B)
flymake--fringe-overlay-spec(BITMAP &optional RECURSED)
flymake--handle-report
flymake--highlight-line(DIAGNOSTIC &optional FOREIGN)
flymake--intersects-p(START0 END0 START1 END1)
flymake--log-1(LEVEL SUBLOG MSG &rest ARGS)
flymake--lookup-type-property(TYPE PROP &optional DEFAULT)
flymake--make-backend-state
flymake--make-backend-state--cmacro
flymake--mode-line-counter(TYPE &optional NO-SPACE)
flymake--mode-line-exception()
flymake--overlays
flymake--project-diagnostics(&optional (PROJECT (project-current)))
flymake--project-diagnostics-buffer(ROOT)
flymake--publish-diagnostics
flymake--run-backend(BACKEND &optional ARGS)
flymake--schedule-timer-maybe()
flymake--severity(TYPE)
flymake--state-diags(CL-X)
flymake--state-diags--cmacro(CL-WHOLE-ARG CL-X)
flymake--state-disabled(CL-X)
flymake--state-disabled--cmacro(CL-WHOLE-ARG CL-X)
flymake--state-foreign-diags(CL-X)
flymake--state-foreign-diags--cmacro(CL-WHOLE-ARG CL-X)
flymake--state-p(CL-X)
flymake--state-p--cmacro(CL-WHOLE-ARG CL-X)
flymake--state-reported-p(CL-X)
flymake--state-reported-p--cmacro(CL-WHOLE-ARG CL-X)
flymake--state-running(CL-X)
flymake--state-running--cmacro(CL-WHOLE-ARG CL-X)
flymake--tabulated-entries-1(DIAGS PROJECT-ROOT)
flymake--update-diagnostics-listings(BUFFER)
flymake--with-backend-state(BACKEND STATE-VAR &rest BODY)
flymake-after-change-function(START STOP LEN)
flymake-diag-region(BUFFER LINE &optional COL)
flymake-diagnostic-backend(DIAG)
flymake-diagnostic-beg(DIAG)
flymake-diagnostic-buffer(DIAG)
flymake-diagnostic-data(DIAG)
flymake-diagnostic-end(DIAG)
flymake-diagnostic-text(DIAG)
flymake-diagnostic-type(DIAG)
flymake-diagnostics(&optional BEG END)
flymake-diagnostics-buffer-mode()
flymake-disabled-backends()
flymake-display-warning(FORMAT-STRING &rest ARGS)
flymake-eldoc-function(REPORT-DOC &rest _)
flymake-error(TEXT &rest ARGS)
flymake-goto-diagnostic(POS)
flymake-goto-next-error(&optional N FILTER INTERACTIVE)
flymake-goto-prev-error(&optional N FILTER INTERACTIVE)
flymake-is-running()
flymake-log(LEVEL MSG &rest ARGS)
flymake-make-diagnostic(LOCUS BEG END TYPE TEXT &optional DATA OVERLAY-PROPERTIES)
flymake-make-report-fn(BACKEND &optional TOKEN)
flymake-menu(ARG1)
flymake-mode(&optional ARG)
flymake-mode-off()
flymake-mode-on()
flymake-project-diagnostics-mode()
flymake-reporting-backends()
flymake-running-backends()
flymake-show-buffer-diagnostics()
flymake-show-diagnostic(POS &optional OTHER-WINDOW)
flymake-show-diagnostics-buffer()
flymake-show-project-diagnostics()
flymake-start(&optional DEFERRED FORCE)
flymake-switch-to-log-buffer()

Defined faces (3)

flymake-errorFace used for marking error regions.
flymake-noteFace used for marking note regions.
flymake-warningFace used for marking warning regions.