summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-12 02:20:14 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-12 02:20:14 +0100
commite13172c2855cc7fcb30c6dac231210c6e8534b18 (patch)
treee9c5a1746535bac89e0f816c9c4851d61d30b97f
parentdc8155b5d0e5c533a1fc6cb64399e8cccd7c1716 (diff)
downloadgeiser-chez-e13172c2855cc7fcb30c6dac231210c6e8534b18.tar.gz
geiser-chez-e13172c2855cc7fcb30c6dac231210c6e8534b18.tar.bz2
Better EOT token for more robust communication
-rw-r--r--elisp/geiser-connection.el10
-rw-r--r--elisp/geiser-guile.el4
-rw-r--r--elisp/geiser-repl.el5
-rw-r--r--scheme/guile/geiser/evaluation.scm1
-rw-r--r--scheme/racket/geiser/eval.rkt3
5 files changed, 14 insertions, 9 deletions
diff --git a/elisp/geiser-connection.el b/elisp/geiser-connection.el
index c50e207..324532b 100644
--- a/elisp/geiser-connection.el
+++ b/elisp/geiser-connection.el
@@ -70,14 +70,14 @@
;;; Connection datatype:
+(defun geiser-con--combined-prompt (prompt debug)
+ (format "\\(%s%s\\)" prompt (if debug (format "\\|%s" debug) "")))
+
(defun geiser-con--make-connection (proc prompt debug-prompt)
(list :geiser-connection
(cons :tq (tq-create proc))
- (cons :eot (format "\\(%s%s\\)"
- prompt
- (if debug-prompt
- (format "\\|%s" debug-prompt)
- "")))
+ (cons :eot (format "\0\n%s"
+ (geiser-con--combined-prompt prompt debug-prompt)))
(cons :prompt prompt)
(cons :debug-prompt debug-prompt)
(cons :count 0)
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index 1295bac..afb7992 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -263,8 +263,8 @@ it spawn a server thread."
`((,geiser-guile--path-rx 1
compilation-error-face)))
(when remote
- (geiser-eval--send/wait (concat (geiser-guile--load-path-string) "\n"))
- (geiser-eval--send/wait ",use (geiser emacs)\n"))
+ (geiser-repl--send-silent (geiser-guile--load-path-string))
+ (geiser-repl--send-silent ",use (geiser emacs)"))
(geiser-guile-update-warning-level))
(defconst geiser-guile--init-server-command
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 2117ff1..d99ace0 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -255,7 +255,7 @@ module command as a string")
prompt-rx
deb-prompt-rx))
(set (make-local-variable 'comint-prompt-regexp)
- (geiser-con--connection-eot geiser-repl--connection))
+ (geiser-con--combined-prompt prompt-rx deb-prompt-rx))
(apply 'make-comint-in-buffer `(,cname ,(current-buffer) ,address)))
(error (insert "Unable to start REPL:\n\n"
(error-message-string err) "\n")
@@ -284,6 +284,9 @@ module command as a string")
(let ((comint-input-filter (lambda (x) nil)))
(comint-send-input nil t))))
+(defun geiser-repl--send-silent (cmd)
+ (comint-redirect-results-list cmd ".+" 0))
+
;;; REPL history and clean-up:
diff --git a/scheme/guile/geiser/evaluation.scm b/scheme/guile/geiser/evaluation.scm
index 305ccfd..d7d0a68 100644
--- a/scheme/guile/geiser/evaluation.scm
+++ b/scheme/guile/geiser/evaluation.scm
@@ -50,6 +50,7 @@
(define (write-result result output)
(write (list (cons 'result result) (cons 'output output)))
+ (write-char #\nul)
(newline))
(define (call-with-result thunk)
diff --git a/scheme/racket/geiser/eval.rkt b/scheme/racket/geiser/eval.rkt
index 78db857..1efaded 100644
--- a/scheme/racket/geiser/eval.rkt
+++ b/scheme/racket/geiser/eval.rkt
@@ -17,7 +17,7 @@
compile-file
macroexpand
make-repl-reader)
-
+
(require geiser/enter geiser/modules geiser/autodoc)
(require errortrace/errortrace-lib)
@@ -57,6 +57,7 @@
(lambda ()
(update-signature-cache spec form)
(eval form (module-spec->namespace spec lang)))))
+ (write-char #\null)
(newline))
(define compile-in eval-in)