diff options
| author | John Wiegley <johnw@newartisans.com> | 2008-09-17 05:50:07 -0400 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2008-09-17 05:50:07 -0400 |
| commit | 387d6dd0a254785ed3f50b8664b35f17f6b873ce (patch) | |
| tree | f4f7a55c0a2d7b6808e19e18da2130c287e479f2 | |
| parent | 33d57dc0f667c8d1168b46f9e73d9510d8c7e518 (diff) | |
Add more delays in case text has not appeared from the command.
Fixes: AF51A38C-36B6-4976-954D-0BCD6C1A81FD
| -rw-r--r-- | TODO | 8 | ||||
| -rw-r--r-- | chess-scid.el | 7 |
2 files changed, 13 insertions, 2 deletions
@@ -15,7 +15,13 @@ EMACS-CHESS -*- mode: org; fill-column: 78 -*- :ID: 130D8091-A1F5-43DC-AFBA-BFDB5D1ADEDF :END: [2008-09-10 Wed 17:04] -* TODO [#B] scid: chess-scid-get-result fails on some machines (timing?) +* DONE [#B] scid: chess-scid-get-result fails on some machines (timing?) + - State "DONE" [2008-09-17 Wed 05:49] \\ + Fixed by adding more delays in case text has not appeared from the command. + - State "STARTED" [2008-09-16 Tue 04:38] \\ + I believe I have a fix for this, commit + 33d57dc0f667c8d1168b46f9e73d9510d8c7e518, but I must await Mario's test on his + 8 CPU machine. It happens on a fast 8-CPU machine of mine that chess-scid-get-result returns the empty string. The reason for this is that sometimes, the prompt is not output immediately after a result, so upon next call to diff --git a/chess-scid.el b/chess-scid.el index 1881c2a..ae491d0 100644 --- a/chess-scid.el +++ b/chess-scid.el @@ -18,9 +18,14 @@ (process-send-string chess-scid-process (concat string "\n"))) (defun chess-scid-get-result (command) - (let ((here (point-max))) + (let ((here (point-max)) (iterations 10)) (chess-scid-send command) (accept-process-output chess-scid-process) + (while (and (> (setq iterations (1- iterations)) 0) + (eobp)) + (accept-process-output chess-scid-process 1 0 t)) + (if (eobp) + (error "chess-scid: '%s' failed to produce any output")) (goto-char (point-max)) (skip-chars-backward " \t\n\r%") (prog1 |
