Skip to content

Commit

Permalink
WIP:
Browse files Browse the repository at this point in the history
  • Loading branch information
carrete committed Apr 17, 2021
1 parent ed130f3 commit 853df5d
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions flycheck.el
Original file line number Diff line number Diff line change
Expand Up @@ -5896,15 +5896,10 @@ Return nil (or raise an error if ERROR is non-nil) when CHECKER's
executable cannot be found, and return a numeric exit status or a
signal description string otherwise. CHECKER's input is taken
from INFILE, and its output is sent to DESTINATION, as in
`start-file-process'."
`call-process'."
(-if-let (executable (flycheck-find-checker-executable checker))
(condition-case err
;; `start-file-process' runs synchronously, like `call-process',
;; when let bound.`start-file-process' is required to support remote
;; processes. See https://github.com/flycheck/flycheck/pull/1842
(let ((rc (apply #'start-file-process
executable infile destination nil args)))
rc)
(apply #'call-process executable infile destination nil args)
(error (when error (signal (car err) (cdr err)))))
(when error
(user-error "Cannot find `%s' using `flycheck-find-checker-executable'"
Expand Down Expand Up @@ -6215,21 +6210,16 @@ and rely on Emacs' own buffering and chunking."
;; can easily use pipes.
(process-connection-type nil))
;; We pass do not associate the process with any buffer, by
;; passing nil for the BUFFER argument of `start-file-process'.
;; passing nil for the BUFFER argument of `start-process'.
;; Instead, we just remember the buffer being checked in a
;; process property (see below). This neatly avoids all
;; side-effects implied by attached a process to a buffer, which
;; may cause conflicts with other packages.
;;
;; See https://github.com/flycheck/flycheck/issues/298 for an
;; example for such a conflict.
;;
;; `start-file-process' runs synchronously, like `call-process',
;; when let bound.`start-file-process' is required to support remote
;; processes. See https://github.com/flycheck/flycheck/pull/1842
(let ((rc (apply 'start-file-process
(format "flycheck-%s" checker) nil command)))
(setq process rc))
(setq process (apply 'start-process (format "flycheck-%s" checker)
nil command))
;; Process sentinels can be called while sending input to the process.
;; We want to record errors raised by process-send before calling
;; `flycheck-handle-signal', so initially just accumulate events.
Expand Down

0 comments on commit 853df5d

Please sign in to comment.