From fef0fe5ed6cec78e87f29444af8d400bcbd01e72 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Tue, 27 Aug 2019 22:00:45 +0200 Subject: [PATCH] Fix flymake-proc temporary file deletion bug * list/progmodes/flymake-proc.el (flymake-proc--process-sentinel): Don't run cleanup if this is an obsolete process -- deleting the temporary file will make the the active process fail since it uses the same file. (Bug#31981) --- lisp/progmodes/flymake-proc.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el index 2d5a47a07978..2095de6117e5 100644 --- a/lisp/progmodes/flymake-proc.el +++ b/lisp/progmodes/flymake-proc.el @@ -649,7 +649,12 @@ flymake-proc--process-sentinel (flymake-log 3 "Output buffer %s kept alive for debugging" output-buffer)) (t - (when (buffer-live-p source-buffer) + (when (and (buffer-live-p source-buffer) + ;; Don't run cleanup if this is an obsolete + ;; process -- deleting the temporary file + ;; will make the the active process fail + ;; since it uses the same file (bug#31981): + (not (process-get proc 'flymake-proc--obsolete))) (with-current-buffer source-buffer (let ((cleanup-f (flymake-proc--get-cleanup-function (buffer-file-name)))) -- 2.20.1