emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/flymake-proselint 1f57a2d: Do not leave process buffers


From: ELPA Syncer
Subject: [elpa] externals/flymake-proselint 1f57a2d: Do not leave process buffers around
Date: Sat, 23 Oct 2021 03:57:26 -0400 (EDT)

branch: externals/flymake-proselint
commit 1f57a2d32808815d014c38a28f307d6bad419caa
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-proselint.el | 51 ++++++++++++++++++++++++++-------------------------
 1 file changed, 26 insertions(+), 25 deletions(-)

diff --git a/flymake-proselint.el b/flymake-proselint.el
index 6d73882..91fef16 100644
--- a/flymake-proselint.el
+++ b/flymake-proselint.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 ;;
 ;; Author: Manuel Uberti <manuel.uberti@inventati.org>
-;; Version: 0.2.1
+;; Version: 0.2.2
 ;; Keywords: convenience
 ;; Package-Requires: ((emacs "26.1"))
 ;; URL: https://github.com/manuel-uberti/flymake-proselint
@@ -51,30 +51,31 @@
         :command '("proselint" "-")
         :sentinel
         (lambda (proc _event)
-          (when (eq 'exit (process-status proc))
-            (unwind-protect
-                (if (with-current-buffer source (eq proc 
flymake-proselint--flymake-proc))
-                    (with-current-buffer (process-buffer proc)
-                      (goto-char (point-min))
-                      (cl-loop
-                       while (search-forward-regexp
-                              "^.+:\\([[:digit:]]+\\):\\([[:digit:]]+\\): 
\\(.+\\)$"
-                              nil t)
-                       for msg = (match-string 3)
-                       for (beg . end) = (flymake-diag-region
-                                          source
-                                          (string-to-number (match-string 1))
-                                          (string-to-number (match-string 2)))
-                       collect (flymake-make-diagnostic source
-                                                        beg
-                                                        end
-                                                        :warning
-                                                        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-proselint--flymake-proc))
+                      (with-current-buffer (process-buffer proc)
+                        (goto-char (point-min))
+                        (cl-loop
+                         while (search-forward-regexp
+                                "^.+:\\([[:digit:]]+\\):\\([[:digit:]]+\\): 
\\(.+\\)$"
+                                nil t)
+                         for msg = (match-string 3)
+                         for (beg . end) = (flymake-diag-region
+                                            source
+                                            (string-to-number (match-string 1))
+                                            (string-to-number (match-string 
2)))
+                         collect (flymake-make-diagnostic source
+                                                          beg
+                                                          end
+                                                          :warning
+                                                          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-proselint--flymake-proc (point-min) 
(point-max))
       (process-send-eof flymake-proselint--flymake-proc))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]