From b98b2cea6ca2a5b244bbb4270d1144e483e54455 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Fri, 12 Nov 2010 01:27:22 +0100 Subject: Nits --- bin/geiser-racket.sh | 2 +- elisp/geiser-connection.el | 25 ++++++++++++------------- elisp/geiser-inf.el | 2 +- elisp/geiser-racket.el | 4 ++-- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/bin/geiser-racket.sh b/bin/geiser-racket.sh index cbe3b9e..5fdfffe 100755 --- a/bin/geiser-racket.sh +++ b/bin/geiser-racket.sh @@ -16,4 +16,4 @@ exec racket -i -S "$top/racket" -l errortrace -cu "$0" ${1+"$@"} (("-p" "--port") p "Geiser server port" (port (string->number p))))) (printf "Geiser server running at port ~a~%" - ((dynamic-require 'geiser/server 'start-geiser))) + ((dynamic-require 'geiser/server 'start-geiser) (port))) 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: diff --git a/elisp/geiser-inf.el b/elisp/geiser-inf.el index 833850a..1e71299 100644 --- a/elisp/geiser-inf.el +++ b/elisp/geiser-inf.el @@ -31,7 +31,7 @@ arguments to be used when invoking the scheme binary.") expression for this implementation's inferior scheme prompt. By default, cmuscheme's prompt regexp will be used.") -(geiser-impl--define-caller geiser-inf--init-server-cmd init-server-cmd () +(geiser-impl--define-caller geiser-inf--init-server-cmd init-server-command () "A variable (or thunk returning a value) giving the REPL server initialization command for local processes. The command must return a list of the form (server PORT).") diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el index 4152a22..4fd0952 100644 --- a/elisp/geiser-racket.el +++ b/elisp/geiser-racket.el @@ -84,7 +84,7 @@ This function uses `geiser-racket-init-file' if it exists." (defconst geiser-racket--prompt-regexp "^=?\\(mzscheme\\|racket\\)@[^ ]*?> ") -(defconst geiser-racket--init-server-cmd ",start-geiser") +(defconst geiser-racket--init-server-command ",start-geiser") ;;; Evaluation support: @@ -243,7 +243,7 @@ using start-geiser, a procedure in the geiser/server module." (unsupported-procedures '(callers callees generic-methods)) (binary geiser-racket--binary) (arglist geiser-racket--parameters) - (init-server-cmd geiser-racket--init-server-cmd) + (init-server-command geiser-racket--init-server-command) (startup) (prompt-regexp geiser-racket--prompt-regexp) (marshall-procedure geiser-racket--geiser-procedure) -- cgit v1.2.3