diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-04-30 00:37:49 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-04-30 00:37:49 +0200 |
commit | 94eee8130f891425ca518c084d5ece65e1ca75b1 (patch) | |
tree | 0543dcb49c72d5942b43266bb738822f01680778 | |
parent | 6f2cfa48bad0c2a55f007b561d0953c8e5557c31 (diff) | |
download | geiser-94eee8130f891425ca518c084d5ece65e1ca75b1.tar.gz geiser-94eee8130f891425ca518c084d5ece65e1ca75b1.tar.bz2 |
Bail out if scheme dies while waiting for an evaluation result.
-rw-r--r-- | elisp/geiser-connection.el | 9 |
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))) |