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

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

[elpa] externals/flymake-proselint aea3a00ec8: Check for live buffer


From: ELPA Syncer
Subject: [elpa] externals/flymake-proselint aea3a00ec8: Check for live buffer
Date: Sat, 19 Nov 2022 00:58:01 -0500 (EST)

branch: externals/flymake-proselint
commit aea3a00ec898bc46b56266e77bf1060950d5f765
Author: Manuel Uberti <manuel.uberti@inventati.org>
Commit: Manuel Uberti <manuel.uberti@inventati.org>

    Check for live buffer
---
 flymake-proselint.el | 39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/flymake-proselint.el b/flymake-proselint.el
index 14c782385a..04428aa6b0 100644
--- a/flymake-proselint.el
+++ b/flymake-proselint.el
@@ -292,25 +292,26 @@ Flymake diagnostic objects."
     (pcase (process-status proc)
       ('exit
        (unwind-protect
-           (with-current-buffer (process-buffer proc)
-             (goto-char (point-min))
-             (cond
-              ((with-current-buffer source
-                 (not (eq proc flymake-proselint--flymake-proc)))
-               (flymake-log :warning "Canceling obsolete check %s" proc))
-              ((= (point-max) (point-min))
-               (flymake-log :debug "Empty response"))
-              ((condition-case err
-                   (let ((response (json-parse-buffer :object-type 'plist
-                                                      :array-type 'list)))
-                     (if (string= (plist-get response :status) "success")
-                         (thread-last
-                           (plist-get response :data)
-                           (flymake-proselint-sentinel-1 source)
-                           (funcall report-fn))
-                       (flymake-log :error "Check failed")))
-                 (json-parse-error
-                  (flymake-log :error "Invalid response: %S" err))))))
+           (when (buffer-live-p (current-buffer))
+             (with-current-buffer (process-buffer proc)
+               (goto-char (point-min))
+               (cond
+                ((with-current-buffer source
+                   (not (eq proc flymake-proselint--flymake-proc)))
+                 (flymake-log :warning "Canceling obsolete check %s" proc))
+                ((= (point-max) (point-min))
+                 (flymake-log :debug "Empty response"))
+                ((condition-case err
+                     (let ((response (json-parse-buffer :object-type 'plist
+                                                        :array-type 'list)))
+                       (if (string= (plist-get response :status) "success")
+                           (thread-last
+                             (plist-get response :data)
+                             (flymake-proselint-sentinel-1 source)
+                             (funcall report-fn))
+                         (flymake-log :error "Check failed")))
+                   (json-parse-error
+                    (flymake-log :error "Invalid response: %S" err)))))))
          (with-current-buffer source
            (setq flymake-proselint--flymake-proc nil))
          (kill-buffer (process-buffer proc))))



reply via email to

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