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-cacheA cache used in ‘flymake-mode-line-counters’.
flymake--original-margin-widthStore original margin width.
flymake--recent-changesRecent changes collected by ‘flymake-after-change-function’.
flymake--stateState of a buffer’s multiple Flymake backends.
flymake-autoresize-marginsIf non-nil, automatically resize margin-width.
flymake-check-start-timeTime at which syntax check was started.
flymake-current-diagnostic-lineThe line of the most recently focused diagnostic in a diagnostics buffer.
flymake-diagnostic-format-alistHow to format diagnostics for different output destinations.
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-buffer-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-indicator-typeIndicate which indicator type to use for display errors.
flymake-list-only-diagnosticsDiagnostics list meant for listing, not highlighting.
flymake-log-levelObsolete and ignored variable.
flymake-margin-indicator-positionThe position to put Flymake margin indicator.
flymake-margin-indicators-stringStrings used for margins indicators.
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-lighterThe string to use in the Flymake mode line.
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-project-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-show-diagnostics-at-end-of-lineIf non-nil, add diagnostic summary messages at end-of-line.
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 (122)

copy-flymake--diag(ARG)
copy-flymake--state(ARG)
flymake--bs-display(TYPE WHERE)
flymake--clear-foreign-diags(STATE)
flymake--clear-state(STATE)
flymake--collect(FN &optional MESSAGE-PREFIX)
flymake--delete-overlay(OV)
flymake--diag-accessor(PUBLIC INTERNAL THING)
flymake--diag-backend(flymake--diag-backend X)
flymake--diag-backend--inliner(INLINE--FORM X)
flymake--diag-beg(flymake--diag-beg X)
flymake--diag-beg--inliner(INLINE--FORM X)
flymake--diag-code(flymake--diag-code X)
flymake--diag-code--inliner(INLINE--FORM X)
flymake--diag-data(flymake--diag-data X)
flymake--diag-data--inliner(INLINE--FORM X)
flymake--diag-end(flymake--diag-end X)
flymake--diag-end--inliner(INLINE--FORM X)
flymake--diag-locus(flymake--diag-locus X)
flymake--diag-locus--inliner(INLINE--FORM X)
flymake--diag-make
flymake--diag-make--cmacro
flymake--diag-message(flymake--diag-message X)
flymake--diag-message--inliner(INLINE--FORM X)
flymake--diag-orig-beg(flymake--diag-orig-beg X)
flymake--diag-orig-beg--inliner(INLINE--FORM X)
flymake--diag-orig-end(flymake--diag-orig-end X)
flymake--diag-orig-end--inliner(INLINE--FORM X)
flymake--diag-origin(flymake--diag-origin X)
flymake--diag-origin--inliner(INLINE--FORM X)
flymake--diag-overlay(flymake--diag-overlay X)
flymake--diag-overlay--inliner(INLINE--FORM X)
flymake--diag-overlay-properties(flymake--diag-overlay-properties X)
flymake--diag-overlay-properties--inliner(INLINE--FORM X)
flymake--diag-p(X)
flymake--diag-p--inliner(INLINE--FORM X)
flymake--diag-type(flymake--diag-type X)
flymake--diag-type--inliner(INLINE--FORM X)
flymake--diagnostics-next-error(N &optional RESET)
flymake--disable-backend(BACKEND &optional EXPLANATION)
flymake--eol-draw-fancy(DIAGS SUMMARIZE-FN)
flymake--eol-draw-fancy-1(TEXT BOXDRAW-FACE LINE-BEG-COL HEIGHT-TO-CLEAR TEXT-BEG-COL TEXT-END-COL)
flymake--eol-overlay-summary(SRC-OVS)
flymake--equal-diagnostic-p(A B)
flymake--fit-diagnostics-window(WINDOW)
flymake--format-diagnostic(DIAG DESTINATION FACE-PROP)
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)
flymake--mode-line-counter-1(TYPE)
flymake--mode-line-counter-scroll-next(EVENT)
flymake--mode-line-counter-scroll-prev(EVENT)
flymake--mode-line-exception()
flymake--project-diagnostics(&optional (PROJECT (project-current)))
flymake--project-diagnostics-buffer(ROOT)
flymake--publish-diagnostics
flymake--really-all-overlays()
flymake--run-backend(BACKEND &optional ARGS)
flymake--schedule-timer-maybe()
flymake--severity(TYPE)
flymake--state-diags(flymake--state-diags X)
flymake--state-diags--inliner(INLINE--FORM X)
flymake--state-disabled(flymake--state-disabled X)
flymake--state-disabled--inliner(INLINE--FORM X)
flymake--state-foreign-diags(flymake--state-foreign-diags X)
flymake--state-foreign-diags--inliner(INLINE--FORM X)
flymake--state-p(X)
flymake--state-p--inliner(INLINE--FORM X)
flymake--state-reported-p(flymake--state-reported-p X)
flymake--state-reported-p--inliner(INLINE--FORM X)
flymake--state-running(flymake--state-running X)
flymake--state-running--inliner(INLINE--FORM X)
flymake--suitably-fringed-p(&optional WINDOW)
flymake--tabulated-setup(USE-PROJECT)
flymake--tabulated-setup-1(DIAGS PROJECT-ROOT)
flymake--update-diagnostics-listings(BUFFER)
flymake--update-eol-overlays()
flymake--with-backend-state(BACKEND STATE-VAR &rest BODY)
flymake-after-change-function(START STOP PRE-CHANGE-LEN)
flymake-diag-region(BUFFER LINE &optional COL)
flymake-diagnostic-backend(DIAG)
flymake-diagnostic-beg(DIAG)
flymake-diagnostic-buffer(DIAG)
flymake-diagnostic-code(DIAG)
flymake-diagnostic-data(DIAG)
flymake-diagnostic-end(DIAG)
flymake-diagnostic-message(DIAG)
flymake-diagnostic-oneliner(DIAG &optional NOPAINTP)
flymake-diagnostic-origin(DIAG)
flymake-diagnostic-text(DIAG &optional (PARTS '(origin code message)))
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 INFO &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(&optional DIAGNOSTIC)
flymake-show-diagnostic(POS &optional OTHER-WINDOW)
flymake-show-diagnostics-buffer(&optional DIAGNOSTIC)
flymake-show-project-diagnostics()
flymake-start(&optional DEFERRED FORCE)
flymake-switch-to-log-buffer()

Defined faces (13)

flymake-end-of-line-diagnostics-faceFace used for end-of-line diagnostics. See variable ‘flymake-show-diagnostics-at-end-of-line’.
flymake-errorFace used for marking error regions.
flymake-error-echoFace used for showing summarized descriptions of errors.
flymake-error-echo-at-eolFace like ‘flymake-error-echo’, but for end-of-line overlays.
flymake-error-fringeFace used by default in the ‘flymake-error-bitmap’.
flymake-noteFace used for marking note regions.
flymake-note-echoFace used for showing summarized descriptions of notes.
flymake-note-echo-at-eolFace like ‘flymake-note-echo’, but for end-of-line overlays.
flymake-note-fringeFace used by default in the ‘flymake-note-bitmap’.
flymake-warningFace used for marking warning regions.
flymake-warning-echoFace used for showing summarized descriptions of warnings.
flymake-warning-echo-at-eolFace like ‘flymake-warning-echo’, but for end-of-line overlays.
flymake-warning-fringeFace used by default in the ‘flymake-warning-bitmap’.