1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 16:51:06 -07:00

Fix Flymake's diagnostic count with custom error types

Fixes: bug#33187

* lisp/progmodes/flymake.el (flymake--mode-line-format): Replace
cl-union with iterative cl-pushnew.
This commit is contained in:
João Távora 2018-10-29 11:41:04 +00:00
parent f3050fc14e
commit 0e6635fdb9

View file

@ -1183,20 +1183,17 @@ default) no filter is applied."
,@(unless (or all-disabled
(null known))
(cl-loop
for (type . severity)
in (cl-sort (mapcar (lambda (type)
(cons type (flymake--severity type)))
(cl-union (hash-table-keys diags-by-type)
'(:error :warning)
:key #'flymake--severity))
#'>
:key #'cdr)
with types = (hash-table-keys diags-by-type)
with _augmented = (cl-loop for extra in '(:error :warning)
do (cl-pushnew extra types
:key #'flymake--severity))
for type in (cl-sort types #'> :key #'flymake--severity)
for diags = (gethash type diags-by-type)
for face = (flymake--lookup-type-property type
'mode-line-face
'compilation-error)
when (or diags
(>= severity (warning-numeric-level :warning)))
when (or diags (>= (flymake--severity type)
(warning-numeric-level :warning)))
collect `(:propertize
,(format "%d" (length diags))
face ,face