Commit c50b5907 authored by João Távora's avatar João Távora
Browse files

Fail earlier if stale Flymake report functions called

If a Flymake backend calls a "stale" report function,
flymake--handle-report might be called for a backend function that is
no longer in the flymake--backend-state hash table.  This patch makes
that erroneous situation slightly more explicit.

* lisp/progmodes/flymake.el (flymake--handle-report): Improve
error reporting.
parent 0db2126d
Pipeline #10221 passed with stages
in 9 minutes and 24 seconds
...@@ -741,7 +741,10 @@ to handle a report even if TOKEN was not expected. REGION is ...@@ -741,7 +741,10 @@ to handle a report even if TOKEN was not expected. REGION is
a (BEG . END) pair of buffer positions indicating that this a (BEG . END) pair of buffer positions indicating that this
report applies to that region." report applies to that region."
(let* ((state (gethash backend flymake--backend-state)) (let* ((state (gethash backend flymake--backend-state))
(first-report (not (flymake--backend-state-reported-p state)))) first-report)
(unless state
(error "Can't find state for %s in `flymake--backend-state'" backend))
(setf first-report (not (flymake--backend-state-reported-p state)))
(setf (flymake--backend-state-reported-p state) t) (setf (flymake--backend-state-reported-p state) t)
(let (expected-token (let (expected-token
new-diags) new-diags)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment