]> git.eshelyaron.com Git - emacs.git/commitdiff
Flymake backends must check proc obsoleteness in source buffer
authorJoão Távora <joaotavora@gmail.com>
Thu, 19 Oct 2017 23:50:34 +0000 (00:50 +0100)
committerJoão Távora <joaotavora@gmail.com>
Thu, 19 Oct 2017 23:50:34 +0000 (00:50 +0100)
Flymake backends that rely on sentinels running asynchronously and
checking buffer-local variables that hold running processes should
check for obsoleteness in the correct buffers, otherwise a (harmless)
warning might be triggered.

* doc/misc/flymake.texi (An annotated example backend):
Check buffer-local proc in the current buffer.

* lisp/progmodes/elisp-mode.el (elisp-flymake-byte-compile):
Check buffer-local proc in the current buffer.

doc/misc/flymake.texi
lisp/progmodes/elisp-mode.el

index 99ab1271ac9ff3129a0ea8f236e8c3dc206a2b5f..2aabaf06b732b650c779ed0173ba592ee01e8e33 100644 (file)
@@ -600,7 +600,7 @@ Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active.
                 ;; `ruby--flymake-proc', which indicates that
                 ;; `proc' is not an obsolete process.
                 ;;
-                (if (eq proc ruby--flymake-proc)
+                (if (with-current-buffer source (eq proc ruby--flymake-proc))
                     (with-current-buffer (process-buffer proc)
                       (goto-char (point-min))
                       ;; Parse the output buffer for diagnostic's
index 99a4841e31815dda8d7d3a85ce1bb8821bb4ec99..41415943a58eaa97f3fe2985b933cd8b0bf49dc0 100644 (file)
@@ -1693,7 +1693,8 @@ current buffer state and calls REPORT-FN when done."
           (when (eq (process-status proc) 'exit)
             (unwind-protect
                 (cond
-                 ((not (eq proc elisp-flymake--byte-compile-process))
+                 ((not (eq proc (with-current-buffer source-buffer
+                                  elisp-flymake--byte-compile-process)))
                   (flymake-log :warning "byte-compile process %s obsolete" proc))
                  ((zerop (process-exit-status proc))
                   (elisp-flymake--byte-compile-done report-fn