[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 1bf5be5 3/5: More carefully cleanup Flymake C/C++ b
From: |
João Távora |
Subject: |
[Emacs-diffs] master 1bf5be5 3/5: More carefully cleanup Flymake C/C++ backend's temp buffers |
Date: |
Tue, 2 Jul 2019 12:11:06 -0400 (EDT) |
branch: master
commit 1bf5be5d37f5bd72aecd2ee266d069d9a9cafc10
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
More carefully cleanup Flymake C/C++ backend's temp buffers
Sometimes the Flymake process dies by some means that doesn't involve
a sentinel call for the "exit" status, so we clean up the temporary
buffer as soon as we notice it's not process-alive-p anymore.
* lisp/progmodes/flymake-cc.el (flymake-cc): Broaden cleanup
conditions.
---
lisp/progmodes/flymake-cc.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lisp/progmodes/flymake-cc.el b/lisp/progmodes/flymake-cc.el
index 5733ef4..ecf6e64 100644
--- a/lisp/progmodes/flymake-cc.el
+++ b/lisp/progmodes/flymake-cc.el
@@ -120,8 +120,8 @@ REPORT-FN is Flymake's callback."
:noquery t :connection-type 'pipe
:sentinel
(lambda (p _ev)
- (when (eq 'exit (process-status p))
- (unwind-protect
+ (unwind-protect
+ (when (eq 'exit (process-status p))
(when (with-current-buffer source (eq p flymake-cc--proc))
(with-current-buffer (process-buffer p)
(goto-char (point-min))
@@ -135,7 +135,8 @@ REPORT-FN is Flymake's callback."
:panic :explanation
(buffer-substring
(point-min) (progn (goto-char (point-min))
- (line-end-position))))))))
+
(line-end-position)))))))))
+ (unless (process-live-p p)
;; (display-buffer (process-buffer p)) ; uncomment to debug
(kill-buffer (process-buffer p)))))))
(process-send-region flymake-cc--proc (point-min) (point-max))