Commit caa63cc9 authored by Stefan Monnier's avatar Stefan Monnier

* lisp/progmodes/flymake.el (flymake-start): Fix dead buffer case

Don't try to flymake-start within a buffer that doesn't exist any more.
parent 9f4f130b
......@@ -601,8 +601,8 @@ not expected."
(null expected-token))
;; should never happen
(flymake-error "Unexpected report from stopped backend %s" backend))
((and (not (eq expected-token token))
(not force))
((not (or (eq expected-token token)
(flymake-error "Obsolete report from backend %s with explanation %s"
backend explanation))
((eq :panic report-action)
......@@ -742,8 +742,11 @@ Interactively, with a prefix arg, FORCE is t."
(remove-hook 'post-command-hook #'start-post-command
(with-current-buffer buffer
(flymake-start (remove 'post-command deferred) force)))
;; The buffer may have disappeared already, e.g. because of
;; code like `(with-temp-buffer (python-mode) ...)'.
(when (buffer-live-p buffer)
(with-current-buffer buffer
(flymake-start (remove 'post-command deferred) force))))
(remove-hook 'window-configuration-change-hook #'start-on-display
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