Skip to content

Commit fd1e0aa

Browse files
committed
Improve performance of inf-clojure--process-response and close #89
Introduce double checking in the busy wait that detects if the inf-clojure process (the REPL) has completed and sent back everything. This removes the slowness that was triggered by having accept-process-output in the while body: we can take advantage now of its output to wait as well.
1 parent c4dac2d commit fd1e0aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

inf-clojure.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -995,8 +995,9 @@ the `inf-clojure-prompt`."
995995
(inf-clojure--sanitize-command command) work-buffer process nil t)
996996
;; Wait for the process to complete
997997
(set-buffer (process-buffer process))
998-
(while (null comint-redirect-completed)
999-
(accept-process-output nil 1))
998+
(while (and (null comint-redirect-completed)
999+
(accept-process-output process 1 0 t))
1000+
(sleep-for 0.01))
10001001
;; Collect the output
10011002
(set-buffer work-buffer)
10021003
(goto-char (point-min))

0 commit comments

Comments
 (0)