Interact with errors¶
There are a couple of things that you can do with Flycheck errors in a buffer:
- You can navigate to errors, and go to the next or previous error.
- You can display errors to read their error messages.
- You can put error messages and IDs into the kill ring.
This section documents the corresponding commands and their customisation options.
Whenever you move point to an error location Flycheck automatically displays all Flycheck errors at point after a short delay which you can customise:
The number of seconds to wait before displaying the error at point. Floating point numbers can express fractions of seconds.
By default Flycheck shows the error messages in the minibuffer or in a separate buffer if the minibuffer is too small to hold the whole error message but this behaviour is entirely customisable:
A function to display errors.
The function is given the list of Flycheck errors to display as sole argument and shall display these errors to the user in some way.
Flycheck provides two built-in functions for this option:
Show error messages and IDs in the echo area or in a separate buffer if the echo area is too small (using
display-message-or-bufferwhich see). The latter only displays errors when the error list is not visible. To enable it add the following to your init file:
(setq flycheck-display-errors-function #'flycheck-display-error-messages-unless-error-list)
- A Flycheck extension to display errors in a GUI popup.
Additionally Flycheck shows errors in a GUI tooltip whenever you hover an error location with the mouse pointer. By default the tooltip contains the messages and IDs of all errors under the pointer, but the contents are customisable:
A function to create the contents of the tooltip.
The function is given a list of Flycheck errors to display as sole argument and shall return a single string to use as the contents of the tooltip.
Flycheck also has the ability to display explanations for errors, provided the
error checker is capable of producing these explanations. Currently, only the
rust-cargo checkers produce explanations.
You can put errors into the kill ring with
C-c ! w:
C-c ! w¶
Copy all messages of the errors at point into the kill ring.