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 good starting points.
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 (45)
flymake--mode-line-counter-cache | A cache used in ‘flymake-mode-line-counters’. |
flymake--original-margin-width | Store original margin width. |
flymake--recent-changes | Recent changes collected by ‘flymake-after-change-function’. |
flymake--state | State of a buffer’s multiple Flymake backends. |
flymake-autoresize-margins | If non-nil, automatically resize margin-width. |
flymake-check-start-time | Time at which syntax check was started. |
flymake-current-diagnostic-line | The line of the most recently focused diagnostic in a diagnostics buffer. |
flymake-diagnostic-format-alist | How to format diagnostics for different output destinations. |
flymake-diagnostic-functions | Special hook of Flymake backends that check a buffer. |
flymake-diagnostics-buffer-mode-abbrev-table | Abbrev table for ‘flymake-diagnostics-buffer-mode’. |
flymake-diagnostics-buffer-mode-hook | Hook run after entering ‘flymake-diagnostics-buffer-mode’. |
flymake-diagnostics-buffer-mode-map | Keymap for ‘flymake-diagnostics-buffer-mode’. |
flymake-diagnostics-buffer-mode-syntax-table | Syntax table for ‘flymake-diagnostics-buffer-mode’. |
flymake-error-bitmap | Bitmap (a symbol) used in the fringe for indicating errors. |
flymake-fringe-indicator-position | The position to put Flymake fringe indicator. |
flymake-gui-warnings-enabled | Enables/disables GUI warnings. |
flymake-indicator-type | Indicate which indicator type to use for display errors. |
flymake-list-only-diagnostics | Diagnostics list meant for listing, not highlighting. |
flymake-log-level | Obsolete and ignored variable. |
flymake-margin-indicator-position | The position to put Flymake margin indicator. |
flymake-margin-indicators-string | Strings used for margins indicators. |
flymake-menu | Flymake menu. |
flymake-mode | Non-nil if Flymake mode is enabled. |
flymake-mode-hook | Hook run after entering or leaving ‘flymake-mode’. |
flymake-mode-line-counter-format | Mode-line construct for formatting Flymake diagnostic counters. |
flymake-mode-line-counters | Mode-line construct for counting Flymake diagnostics. |
flymake-mode-line-exception | Mode-line construct to report on exceptional Flymake status. |
flymake-mode-line-format | Mode line construct for customizing Flymake information. |
flymake-mode-line-lighter | The string to use in the Flymake mode line. |
flymake-mode-line-title | Mode-line construct to show Flymake’s mode name and menu. |
flymake-mode-map | Keymap for ‘flymake-mode’ |
flymake-no-changes-timeout | Time to wait after last change before automatically checking buffer. |
flymake-note-bitmap | Bitmap (a symbol) used in the fringe for indicating info notes. |
flymake-project-diagnostics-mode-abbrev-table | Abbrev table for ‘flymake-project-diagnostics-mode’. |
flymake-project-diagnostics-mode-hook | Hook run after entering ‘flymake-project-diagnostics-mode’. |
flymake-project-diagnostics-mode-map | Keymap for ‘flymake-project-diagnostics-mode’. |
flymake-project-diagnostics-mode-syntax-table | Syntax table for ‘flymake-project-diagnostics-mode’. |
flymake-show-diagnostics-at-end-of-line | If non-nil, add diagnostic summary messages at end-of-line. |
flymake-start-on-flymake-mode | If non-nil, start syntax check when ‘flymake-mode’ is enabled. |
flymake-start-on-save-buffer | If non-nil, start syntax check when a buffer is saved. |
flymake-start-syntax-check-on-find-file | If non-nil, start syntax check when ‘flymake-mode’ is enabled. |
flymake-suppress-zero-counters | Control appearance of zero-valued diagnostic counters in mode line. |
flymake-timer | Timer for starting syntax check. |
flymake-warning-bitmap | Bitmap (a symbol) used in the fringe for indicating warnings. |
flymake-wrap-around | If non-nil, moving to errors wraps around buffer boundaries. |
Defined functions (122)
Defined faces (13)
flymake-end-of-line-diagnostics-face | Face used for end-of-line diagnostics. See variable ‘flymake-show-diagnostics-at-end-of-line’. |
flymake-error | Face used for marking error regions. |
flymake-error-echo | Face used for showing summarized descriptions of errors. |
flymake-error-echo-at-eol | Face like ‘flymake-error-echo’, but for end-of-line overlays. |
flymake-error-fringe | Face used by default in the ‘flymake-error-bitmap’. |
flymake-note | Face used for marking note regions. |
flymake-note-echo | Face used for showing summarized descriptions of notes. |
flymake-note-echo-at-eol | Face like ‘flymake-note-echo’, but for end-of-line overlays. |
flymake-note-fringe | Face used by default in the ‘flymake-note-bitmap’. |
flymake-warning | Face used for marking warning regions. |
flymake-warning-echo | Face used for showing summarized descriptions of warnings. |
flymake-warning-echo-at-eol | Face like ‘flymake-warning-echo’, but for end-of-line overlays. |
flymake-warning-fringe | Face used by default in the ‘flymake-warning-bitmap’. |