From: "Michał Krzywkowski" <k.michal@zoho.com>
To: 33187@debbugs.gnu.org
Subject: bug#33187: 27.0.50; flymake-mode's lighter shows incorrect diagnostic count
Date: Sat, 27 Oct 2018 14:25:22 +0200 [thread overview]
Message-ID: <166b57c6ede.d6fb0e9d77549.5516395024161061280@zoho.com> (raw)
In-Reply-To:
[-- Attachment #1: Type: text/plain, Size: 942 bytes --]
After evaluating the sexp below, flymake's lighter shows [0 0]
diagnostics, despite the fact that a warning is present in the buffer.
If you uncomment the comment, flymake correctly shows that there are [1 1] diagnostics.
(with-current-buffer (get-buffer-create "*scratch*")
(erase-buffer)
(insert "aaaaa")
(put 'my-warning 'flymake-category 'flymake-warning)
(put 'my-error 'flymake-category 'flymake-error)
(defun check-buffer (fn &rest)
(with-current-buffer "*scratch*"
(funcall
fn (list
(flymake-make-diagnostic (current-buffer) 1 2 'my-warning "Warning.")
;; (flymake-make-diagnostic (current-buffer) 2 3 'my-error "Error.")
))))
(setq flymake-diagnostic-functions '(check-buffer))
(flymake-mode +1)
(pop-to-buffer (current-buffer)))
The attached patch fixes this issue.
Repository revision: 3e81e9a0e7742197354515f3d3ea55fdb201eb29
[-- Attachment #2: 0001-Fix-Flymake-s-lighter-displaying-incorrect-diagnosti.patch --]
[-- Type: application/octet-stream, Size: 1380 bytes --]
From 590c94d38cf2786093120b4952813e25ed94fb41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Krzywkowski?= <k.michal@zoho.com>
Date: Sat, 27 Oct 2018 14:08:11 +0200
Subject: [PATCH] Fix Flymake's lighter displaying incorrect diagnostic count
* lisp/progmodes/flymake.el (flymake--mode-line-format): Lookup
diagnostics by their severity when custom diagnostic types are used.
---
lisp/progmodes/flymake.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 5831301a57..6a1cf5628e 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1191,7 +1191,10 @@ flymake--mode-line-format
:key #'flymake--severity))
#'>
:key #'cdr)
- for diags = (gethash type diags-by-type)
+ for diags = (or (gethash type diags-by-type)
+ (cl-loop for k being the hash-keys of diags-by-type
+ when (eq severity (flymake--severity k))
+ return (gethash k diags-by-type)))
for face = (flymake--lookup-type-property type
'mode-line-face
'compilation-error)
--
2.11.0
next reply other threads:[~2018-10-27 12:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-27 12:25 Michał Krzywkowski [this message]
2018-10-29 11:52 ` bug#33187: 27.0.50; flymake-mode's lighter shows incorrect diagnostic count João Távora
2018-10-29 17:32 ` Michał Krzywkowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=166b57c6ede.d6fb0e9d77549.5516395024161061280@zoho.com \
--to=k.michal@zoho.com \
--cc=33187@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.