emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 caa63cc: * lisp/progmodes/flymake.el (flymake-sta


From: Stefan Monnier
Subject: [Emacs-diffs] emacs-26 caa63cc: * lisp/progmodes/flymake.el (flymake-start): Fix dead buffer case
Date: Fri, 3 Nov 2017 08:33:30 -0400 (EDT)

branch: emacs-26
commit caa63cc96cfd2d21872eba17a474b4535178ad58
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * 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.
---
 lisp/progmodes/flymake.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 1048bc5..c2349d8 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -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)
+                 force))
         (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
                        nil)
-          (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))))
          (start-on-display
           ()
           (remove-hook 'window-configuration-change-hook #'start-on-display



reply via email to

[Prev in Thread] Current Thread [Next in Thread]