branch: elpa/flymake-collection
commit 0dc266c443bb9553f529a848c20a2b4c00cec649
Author: Mohsin Kaleem <mohk...@kisara.moe>
Commit: Mohsin Kaleem <mohk...@kisara.moe>

    define: Auto suppress errors when sending data to process
    
    I encountered an error with jq when sending a large file to the checker.
    I think when jq encounters an error it exits immediately instead of
    waiting for the rest of stdin to be sent. Emacs then just keeps trying
    to send data to the process which then triggers an error from the checker.
    This is an issue because flymake will disable the checker when it
    encounters this. For now we work around it by just catching and logging
    any errors at that point in the function.
---
 src/flymake-collection-define.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/flymake-collection-define.el b/src/flymake-collection-define.el
index 72557687fc..b096e9a117 100644
--- a/src/flymake-collection-define.el
+++ b/src/flymake-collection-define.el
@@ -309,8 +309,11 @@ exit status %d\nStderr: %s"
              ;; If piping, send data to the process.
              ,@(when (eq write-type 'pipe)
                  `((when (process-live-p ,proc-symb)
-                     (process-send-region ,proc-symb (point-min) (point-max))
-                     (process-send-eof ,proc-symb))))
+                     (condition-case-unless-debug error
+                         (progn
+                           (process-send-region ,proc-symb (point-min) 
(point-max))
+                           (process-send-eof ,proc-symb))
+                       (error (flymake-log :error "Could not send stdin to 
checker %s" error))))))
              ;; Return value of syntax-checker is checker function.
              ,proc-symb))))))
 

Reply via email to