diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-12 01:27:22 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-12 01:27:22 +0100 |
commit | b98b2cea6ca2a5b244bbb4270d1144e483e54455 (patch) | |
tree | 9cb97e76ae10af2d54f6264deb2182edb9839113 /elisp/geiser-connection.el | |
parent | 70cfa5b379e90e6899c7e1a210a5c468dc578479 (diff) | |
download | geiser-guile-b98b2cea6ca2a5b244bbb4270d1144e483e54455.tar.gz geiser-guile-b98b2cea6ca2a5b244bbb4270d1144e483e54455.tar.bz2 |
Nits
Diffstat (limited to 'elisp/geiser-connection.el')
-rw-r--r-- | elisp/geiser-connection.el | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/elisp/geiser-connection.el b/elisp/geiser-connection.el index d1e7d59..c50e207 100644 --- a/elisp/geiser-connection.el +++ b/elisp/geiser-connection.el @@ -136,22 +136,21 @@ (let ((tq (geiser-con--connection-tq con))) (and tq (tq-close tq)))) -(defvar geiser-con--connection-sentinel nil) -(defun geiser-con--connection-sentinel (p s) - (setq geiser-con--connection-sentinel - (concat geiser-con--connection-sentinel s))) +(defvar geiser-con--startup-prompt nil) +(defun geiser-con--startup-prompt (p s) + (setq geiser-con--startup-prompt + (concat geiser-con--startup-prompt s)) + nil) (defun geiser-con--open-connection (host port prompt debug-prompt) - (setq geiser-con--connection-sentinel "") - (let ((proc (make-network-process :name "geiser-con" - :host host - :service port - :filter 'geiser-con--connection-sentinel - :noquery t))) + (setq geiser-con--startup-prompt "") + (let* ((name (format "geiser-con@%s:%s" host port)) + (proc (open-network-stream name nil host port))) + (set-process-filter proc 'geiser-con--startup-prompt) (with-timeout (10 (error (format "Timeout connecting to %s:%s" host port))) - (while (not (string-match prompt geiser-con--connection-sentinel)) - (accept-process-output proc 1))) + (while (not (string-match prompt geiser-con--startup-prompt)) + (accept-process-output proc 0.05))) (geiser-con--make-connection proc prompt debug-prompt))) @@ -193,7 +192,7 @@ (geiser-con--connection-eot c) r 'geiser-con--process-completed-request - t)) + nil)) ;;; Message sending interface: |