aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2018-10-29 11:41:04 +0000
committerJoão Távora2018-10-29 11:46:11 +0000
commit0e6635fdb9ad34dea0540c121c8b981a4fc14832 (patch)
tree2cce62e9aae58b02cc5bf3e35fa8eee6c5776ad5
parentf3050fc14e05a6eb18a70e0e7ce5d5302d5203e6 (diff)
downloademacs-0e6635fdb9ad34dea0540c121c8b981a4fc14832.tar.gz
emacs-0e6635fdb9ad34dea0540c121c8b981a4fc14832.zip
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.
-rw-r--r--lisp/progmodes/flymake.el17
1 files changed, 7 insertions, 10 deletions
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 5831301a57c..f0f93f10878 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1183,20 +1183,17 @@ default) no filter is applied."
1183 ,@(unless (or all-disabled 1183 ,@(unless (or all-disabled
1184 (null known)) 1184 (null known))
1185 (cl-loop 1185 (cl-loop
1186 for (type . severity) 1186 with types = (hash-table-keys diags-by-type)
1187 in (cl-sort (mapcar (lambda (type) 1187 with _augmented = (cl-loop for extra in '(:error :warning)
1188 (cons type (flymake--severity type))) 1188 do (cl-pushnew extra types
1189 (cl-union (hash-table-keys diags-by-type) 1189 :key #'flymake--severity))
1190 '(:error :warning) 1190 for type in (cl-sort types #'> :key #'flymake--severity)
1191 :key #'flymake--severity))
1192 #'>
1193 :key #'cdr)
1194 for diags = (gethash type diags-by-type) 1191 for diags = (gethash type diags-by-type)
1195 for face = (flymake--lookup-type-property type 1192 for face = (flymake--lookup-type-property type
1196 'mode-line-face 1193 'mode-line-face
1197 'compilation-error) 1194 'compilation-error)
1198 when (or diags 1195 when (or diags (>= (flymake--severity type)
1199 (>= severity (warning-numeric-level :warning))) 1196 (warning-numeric-level :warning)))
1200 collect `(:propertize 1197 collect `(:propertize
1201 ,(format "%d" (length diags)) 1198 ,(format "%d" (length diags))
1202 face ,face 1199 face ,face