[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/flymake-kondor 389b513 1/3: Do not leave process buffers a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/flymake-kondor 389b513 1/3: Do not leave process buffers around |
Date: |
Sat, 23 Oct 2021 03:57:58 -0400 (EDT) |
branch: elpa/flymake-kondor
commit 389b513c7287ede7a996a3d0db2e84b00772fef5
Author: Manuel Uberti <manuel.uberti@inventati.org>
Commit: Manuel Uberti <manuel.uberti@inventati.org>
Do not leave process buffers around
See: https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01644.html
---
flymake-kondor.el | 53 +++++++++++++++++++++++++++--------------------------
1 file changed, 27 insertions(+), 26 deletions(-)
diff --git a/flymake-kondor.el b/flymake-kondor.el
index 1b5120d..ad96f22 100644
--- a/flymake-kondor.el
+++ b/flymake-kondor.el
@@ -4,7 +4,7 @@
;;
;; Author: https://turbocafe.keybase.pub
;; Created: 3 November 2019
-;; Version: 0.1.0
+;; Version: 0.1.1
;; Package-Requires: ((emacs "26.1"))
;; URL: https://github.com/turbo-cafe/flymake-kondor
;;; Commentary:
@@ -59,31 +59,32 @@
:command `("clj-kondo" "--lint" "-" "--lang" ,lang)
:sentinel
(lambda (proc _event)
- (when (eq 'exit (process-status proc))
- (unwind-protect
- (if (with-current-buffer source (eq proc
flymake-kondor--flymake-proc))
- (with-current-buffer (process-buffer proc)
- (goto-char (point-min))
- (cl-loop
- while (search-forward-regexp
- "^.+:\\([[:digit:]]+\\):\\([[:digit:]]+\\):
\\([[:alpha:]]+\\): \\(.+\\)$"
- nil t)
- for lnum = (string-to-number (match-string 1))
- for lcol = (string-to-number (match-string 2))
- for type = (let ((severity (match-string 3)))
- (cond
- ((string= severity "error") :error)
- ((string= severity "warning") :warning)
- ((string= severity "info") :note)
- (t :note)))
- for msg = (match-string 4)
- for (beg . end) = (flymake-diag-region source lnum lcol)
- collect (flymake-make-diagnostic source beg end type
msg)
- into diags
- finally (funcall report-fn diags)))
- (flymake-log :warning "Canceling obsolete check %s"
- proc))
- (kill-buffer (process-buffer proc)))))))
+ (let ((status (process-status proc)))
+ (when (or (eq status 'exit) (eq status 'signal))
+ (unwind-protect
+ (if (with-current-buffer source (eq proc
flymake-kondor--flymake-proc))
+ (with-current-buffer (process-buffer proc)
+ (goto-char (point-min))
+ (cl-loop
+ while (search-forward-regexp
+ "^.+:\\([[:digit:]]+\\):\\([[:digit:]]+\\):
\\([[:alpha:]]+\\): \\(.+\\)$"
+ nil t)
+ for lnum = (string-to-number (match-string 1))
+ for lcol = (string-to-number (match-string 2))
+ for type = (let ((severity (match-string 3)))
+ (cond
+ ((string= severity "error") :error)
+ ((string= severity "warning") :warning)
+ ((string= severity "info") :note)
+ (t :note)))
+ for msg = (match-string 4)
+ for (beg . end) = (flymake-diag-region source lnum
lcol)
+ collect (flymake-make-diagnostic source beg end type
msg)
+ into diags
+ finally (funcall report-fn diags)))
+ (flymake-log :warning "Canceling obsolete check %s"
+ proc))
+ (kill-buffer (process-buffer proc))))))))
(process-send-region flymake-kondor--flymake-proc (point-min)
(point-max))
(process-send-eof flymake-kondor--flymake-proc))))