summaryrefslogtreecommitdiff
path: root/elisp/geiser-connection.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-04-30 00:37:49 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-04-30 00:37:49 +0200
commiteb521e1ecc9a27e3ef208a6a4d01ec6edb88a0f7 (patch)
treeb65e25199ed23702c4bc76560d6f0a148e46fbb9 /elisp/geiser-connection.el
parent62a12ad5d23520d93a30c38db083bdbfd248b77e (diff)
downloadgeiser-chez-eb521e1ecc9a27e3ef208a6a4d01ec6edb88a0f7.tar.gz
geiser-chez-eb521e1ecc9a27e3ef208a6a4d01ec6edb88a0f7.tar.bz2
Bail out if scheme dies while waiting for an evaluation result.
Diffstat (limited to 'elisp/geiser-connection.el')
-rw-r--r--elisp/geiser-connection.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/elisp/geiser-connection.el b/elisp/geiser-connection.el
index b78982c..7312de4 100644
--- a/elisp/geiser-connection.el
+++ b/elisp/geiser-connection.el
@@ -91,6 +91,9 @@
(defsubst geiser-con--connection-buffer (c)
(cdr (assoc :buffer c)))
+(defsubst geiser-con--connection-process (c)
+ (get-buffer-process (geiser-con--connection-buffer c)))
+
(defsubst geiser-con--connection-requests (c)
(cdr (assoc :requests c)))
@@ -226,8 +229,9 @@
(defun geiser-con--send-string/wait (buffer/proc str cont &optional timeout sbuf)
(save-current-buffer
- (let ((con (geiser-con--get-connection buffer/proc)))
- (unless con (error geiser-con--error-message))
+ (let* ((con (geiser-con--get-connection buffer/proc))
+ (proc (geiser-con--connection-process con)))
+ (unless proc (error geiser-con--error-message))
(let* ((req (geiser-con--send-string buffer/proc str cont sbuf))
(id (and req (geiser-con--request-id req)))
(time (or timeout geiser-connection-timeout))
@@ -236,6 +240,7 @@
(when id
(condition-case nil
(while (and (> time 0)
+ (geiser-con--connection-process con)
(not (geiser-con--connection-completed-p con id)))
(accept-process-output nil waitsecs)
(setq time (- time step)))