aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2019-03-28 18:04:35 +0000
committerJoão Távora2019-07-02 16:09:59 +0100
commit1bf5be5d37f5bd72aecd2ee266d069d9a9cafc10 (patch)
treecb6fe6bd6efd6fbdc5d922d8d17ab8917ddf9a09
parent1625fc184bebf0ce3c2782563aaa4029cdc95f3d (diff)
downloademacs-1bf5be5d37f5bd72aecd2ee266d069d9a9cafc10.tar.gz
emacs-1bf5be5d37f5bd72aecd2ee266d069d9a9cafc10.zip
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.
-rw-r--r--lisp/progmodes/flymake-cc.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/progmodes/flymake-cc.el b/lisp/progmodes/flymake-cc.el
index 5733ef4d666..ecf6e648a7e 100644
--- a/lisp/progmodes/flymake-cc.el
+++ b/lisp/progmodes/flymake-cc.el
@@ -120,8 +120,8 @@ REPORT-FN is Flymake's callback."
120 :noquery t :connection-type 'pipe 120 :noquery t :connection-type 'pipe
121 :sentinel 121 :sentinel
122 (lambda (p _ev) 122 (lambda (p _ev)
123 (when (eq 'exit (process-status p)) 123 (unwind-protect
124 (unwind-protect 124 (when (eq 'exit (process-status p))
125 (when (with-current-buffer source (eq p flymake-cc--proc)) 125 (when (with-current-buffer source (eq p flymake-cc--proc))
126 (with-current-buffer (process-buffer p) 126 (with-current-buffer (process-buffer p)
127 (goto-char (point-min)) 127 (goto-char (point-min))
@@ -135,7 +135,8 @@ REPORT-FN is Flymake's callback."
135 :panic :explanation 135 :panic :explanation
136 (buffer-substring 136 (buffer-substring
137 (point-min) (progn (goto-char (point-min)) 137 (point-min) (progn (goto-char (point-min))
138 (line-end-position)))))))) 138 (line-end-position)))))))))
139 (unless (process-live-p p)
139 ;; (display-buffer (process-buffer p)) ; uncomment to debug 140 ;; (display-buffer (process-buffer p)) ; uncomment to debug
140 (kill-buffer (process-buffer p))))))) 141 (kill-buffer (process-buffer p)))))))
141 (process-send-region flymake-cc--proc (point-min) (point-max)) 142 (process-send-region flymake-cc--proc (point-min) (point-max))