summaryrefslogtreecommitdiff
path: root/scheme/guile/geiser/emacs.scm
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-12 01:33:09 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-12 01:33:09 +0100
commitdc8155b5d0e5c533a1fc6cb64399e8cccd7c1716 (patch)
tree630f0ac4050f3f4179e0a8402f3b0e88c539b012 /scheme/guile/geiser/emacs.scm
parent24fe735860a68542bb569bb59c712995f7bd1deb (diff)
downloadgeiser-chez-dc8155b5d0e5c533a1fc6cb64399e8cccd7c1716.tar.gz
geiser-chez-dc8155b5d0e5c533a1fc6cb64399e8cccd7c1716.tar.bz2
Guile reconnected (but not debuggable (yet))
Or the importance of EOL. Switching to a transaction queue for communication with the Scheme process means that i had to care about sending eols in the queries... Guile was waiting for ever reading a metacommand taking a variable number of arguments. Argh: this has taken me a few hours -- i'm getting old.
Diffstat (limited to 'scheme/guile/geiser/emacs.scm')
-rw-r--r--scheme/guile/geiser/emacs.scm23
1 files changed, 17 insertions, 6 deletions
diff --git a/scheme/guile/geiser/emacs.scm b/scheme/guile/geiser/emacs.scm
index 54e5d34..9e3d410 100644
--- a/scheme/guile/geiser/emacs.scm
+++ b/scheme/guile/geiser/emacs.scm
@@ -13,6 +13,7 @@
#:use-module (ice-9 match)
#:use-module (system repl command)
#:use-module (system repl error-handling)
+ #:use-module (system repl server)
#:use-module (geiser evaluation)
#:use-module ((geiser modules) :renamer (symbol-prefix-proc 'ge:))
#:use-module ((geiser completion) :renamer (symbol-prefix-proc 'ge:))
@@ -26,8 +27,13 @@
No-op command used internally by Geiser."
(values))
+(define-meta-command ((geiser-newline geiser) repl)
+ "geiser-newline
+Meta-command used by Geiser to emit a new line."
+ (newline))
+
(define-meta-command ((geiser-eval geiser) repl (mod form args) . rest)
- "geiser-eval
+ "geiser-eval module form args ()
Meta-command used by Geiser to evaluate and compile code."
(if (null? args)
(call-with-error-handling
@@ -36,12 +42,17 @@ Meta-command used by Geiser to evaluate and compile code."
(ge:eval `(,proc ,@args) mod))))
(define-meta-command ((geiser-load-file geiser) repl file)
- "geiser-load-file
+ "geiser-load-file file
Meta-command used by Geiser to load and compile files."
(call-with-error-handling
(lambda () (ge:compile-file file))))
-(define-meta-command ((geiser-newline geiser) repl)
- "geiser-newline
-Meta-command used by Geiser to emit a new line."
- (newline))
+
+(define-meta-command ((geiser-start-server geiser) repl)
+ "geiser-start-server
+Meta-command used by Geiser to start a REPL server."
+ (let* ((sock (make-tcp-server-socket #:port 0))
+ (port (sockaddr:port (getsockname sock))))
+ (spawn-server sock)
+ (write (list 'port port))
+ (newline)))