\input texinfo @c -*- mode: texinfo; coding: utf-8 -*-
@comment %**start of header
@setfilename ../../info/flymake.info
-@set VERSION 1.2.2
-@set UPDATED November 2021
+@set VERSION 1.3.3
+@set UPDATED April 2023
@settitle GNU Flymake @value{VERSION}
@include docstyle.texi
@syncodeindex pg cp
@item
@cindex severity of diagnostic
-@code{flymake-severity} is a non-negative integer specifying the
+@code{severity} is a non-negative integer specifying the
diagnostic's severity. The higher the value, the more serious is the
error. If the overlay property @code{priority} is not specified in
@code{flymake-overlay-control}, @code{flymake-severity} is used to set
@vindex flymake-category
@code{flymake-category} is a symbol whose property list is considered
the default for missing values of any other properties.
+
+@item
+@cindex mode-line appearance of a diagnostic
+@code{mode-line-face} is a face specifier controlling the appearance
+of the indicator of this type of diagnostic in the mode line.
+
+@item
+@cindex summarized appearance of a diagnostic
+@code{echo-face} is a face specifier controlling the appearance of the
+summarized description of this diagnostic when reading diagnostic
+messages (@pxref{Finding diagnostics}).
@end itemize
@cindex predefined diagnostic types
;; Author: Pavel Kobyakov <pk_at_work@yahoo.com>
;; Maintainer: João Távora <joaotavora@gmail.com>
-;; Version: 1.3.2
+;; Version: 1.3.3
;; Keywords: c languages tools
;; Package-Requires: ((emacs "26.1") (eldoc "1.14.0") (project "0.7.1"))
(flymake--diag-accessor flymake-diagnostic-end flymake--diag-end end)
(flymake--diag-accessor flymake-diagnostic-buffer flymake--diag-locus locus)
-(defun flymake-diagnostic-oneliner (diag)
- "Get truncated one-line text string for diagnostic DIAG."
- (let ((txt (flymake-diagnostic-text diag)))
- (substring txt 0 (cl-loop for i from 0 for a across txt
- when (eq a ?\n) return i))))
+(defun flymake-diagnostic-oneliner (diag &optional nopaintp)
+ "Get truncated one-line text string for diagnostic DIAG.
+This is useful for displaying the DIAG's text to the user in
+confined spaces, such as the echo are. Unless NOPAINTP is t,
+propertize returned text with the `echo-face' property of DIAG's
+type."
+ (let* ((txt (flymake-diagnostic-text diag))
+ (txt (substring txt 0 (cl-loop for i from 0 for a across txt
+ when (eq a ?\n) return i))))
+ (if nopaintp txt
+ (propertize txt 'face
+ (flymake--lookup-type-property
+ (flymake-diagnostic-type diag) 'echo-face 'flymake-error)))))
(cl-defun flymake--overlays (&key beg end filter compare key)
"Get flymake-related overlays.
(put 'flymake-error 'flymake-bitmap 'flymake-error-bitmap)
(put 'flymake-error 'severity (warning-numeric-level :error))
(put 'flymake-error 'mode-line-face 'compilation-error)
+(put 'flymake-error 'echo-face 'error)
(put 'flymake-error 'flymake-type-name "error")
(put 'flymake-warning 'face 'flymake-warning)
(put 'flymake-warning 'flymake-bitmap 'flymake-warning-bitmap)
(put 'flymake-warning 'severity (warning-numeric-level :warning))
(put 'flymake-warning 'mode-line-face 'compilation-warning)
+(put 'flymake-warning 'echo-face 'warning)
(put 'flymake-warning 'flymake-type-name "warning")
(put 'flymake-note 'face 'flymake-note)
(put 'flymake-note 'flymake-bitmap 'flymake-note-bitmap)
(put 'flymake-note 'severity (warning-numeric-level :debug))
(put 'flymake-note 'mode-line-face 'compilation-info)
+(put 'flymake-note 'echo-face 'compilation-info)
(put 'flymake-note 'flymake-type-name "note")
(defun flymake--lookup-type-property (type prop &optional default)
(lambda (window _ov pos)
(with-selected-window window
(mapconcat
- #'flymake-diagnostic-text
+ #'flymake-diagnostic-oneliner
(flymake-diagnostics pos)
"\n"))))
(default-maybe 'severity (warning-numeric-level :error))
(when-let ((diags (flymake-diagnostics (point))))
(funcall report-doc
(mapconcat #'flymake-diagnostic-text diags "\n")
- :echo (mapconcat (lambda (d)
- (propertize (flymake-diagnostic-oneliner d)
- 'face
- (flymake--lookup-type-property
- (flymake-diagnostic-type d)
- 'face
- 'flymake-error)))
+ :echo (mapconcat #'flymake-diagnostic-oneliner
diags "\n"))))
(defun flymake-goto-next-error (&optional n filter interactive)
"\\1\\2" bname)
"(anon)")
'help-echo (format "From `%s' backend" backend))
- (,(flymake-diagnostic-oneliner diag)
+ (,(flymake-diagnostic-oneliner diag t)
mouse-face highlight
help-echo "mouse-2: visit this diagnostic"
face nil