summaryrefslogtreecommitdiff
path: root/elisp
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 /elisp
parent24fe735860a68542bb569bb59c712995f7bd1deb (diff)
downloadgeiser-guile-dc8155b5d0e5c533a1fc6cb64399e8cccd7c1716.tar.gz
geiser-guile-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 'elisp')
-rw-r--r--elisp/geiser-guile.el37
-rw-r--r--elisp/geiser-racket.el1
-rw-r--r--elisp/geiser-repl.el6
3 files changed, 26 insertions, 18 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index 3979688..1295bac 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -101,15 +101,14 @@ This function uses `geiser-guile-init-file' if it exists."
(let ((init-file (and (stringp geiser-guile-init-file)
(expand-file-name geiser-guile-init-file))))
`(,@(and (listp geiser-guile-binary) (cdr geiser-guile-binary))
- "-q"
+ "-q" "-L" ,(expand-file-name "guile/" geiser-scheme-dir)
,@(apply 'append (mapcar (lambda (p) (list "-L" p)) geiser-guile-load-path))
,@(and init-file (file-readable-p init-file) (list "-l" init-file)))))
-(defconst geiser-guile--prompt-regexp "^[^() \n]+@([^)]*?)> ")
+;;(defconst geiser-guile--prompt-regexp "^[^() \n]+@([^)]*?)> ")
+(defconst geiser-guile--prompt-regexp "[^@()]+@([^)]*?)> ")
(defconst geiser-guile--debugger-prompt-regexp
- "^[^() \n]+@([^)]*?) \\[[0-9]+\\]> ")
-(defconst geiser-guile--debugger-preamble-regexp
- "^Entering a new prompt\\. ")
+ "^[^@()]+@([^)]*?) \\[[0-9]+\\]> ")
;;; Evaluation support:
@@ -118,7 +117,7 @@ This function uses `geiser-guile-init-file' if it exists."
(defun geiser-guile--geiser-procedure (proc &rest args)
(case proc
- ((eval compile) (format ",geiser-eval %s %s%s"
+ ((eval compile) (format ",geiser-eval %s %s%s\n"
(or (car args) "#f")
(geiser-guile--linearize-args (cdr args))
(if (cddr args) "" " ()")))
@@ -248,7 +247,14 @@ it spawn a server thread."
(interactive)
(geiser-connect 'guile))
-(defun geiser-guile--startup ()
+(defun geiser-guile--load-path-string ()
+ (let* ((path (expand-file-name "guile/" geiser-scheme-dir))
+ (witness "geiser/emacs.scm")
+ (code `(if (not (%search-load-path ,witness))
+ (set! %load-path (cons ,path %load-path)))))
+ (geiser-eval--scheme-str code)))
+
+(defun geiser-guile--startup (remote)
(set (make-local-variable 'compilation-error-regexp-alist)
`((,geiser-guile--path-rx geiser-guile--resolve-file-x)
("^ +\\([0-9]+\\):\\([0-9]+\\)" nil 1 2)))
@@ -256,23 +262,26 @@ it spawn a server thread."
(font-lock-add-keywords nil
`((,geiser-guile--path-rx 1
compilation-error-face)))
- (geiser-eval--send/wait
- (format "(set! %%load-path (cons %S %%load-path))"
- (expand-file-name "guile/" geiser-scheme-dir)))
- (geiser-eval--send/wait ",use (geiser emacs)")
+ (when remote
+ (geiser-eval--send/wait (concat (geiser-guile--load-path-string) "\n"))
+ (geiser-eval--send/wait ",use (geiser emacs)\n"))
(geiser-guile-update-warning-level))
+(defconst geiser-guile--init-server-command
+ ",use (geiser emacs)\n,geiser-start-server")
+
;;; Implementation definition:
(define-geiser-implementation guile
(binary geiser-guile--binary)
(arglist geiser-guile--parameters)
- (startup geiser-guile--startup)
+ (repl-startup geiser-guile--startup)
(prompt-regexp geiser-guile--prompt-regexp)
- (enter-debugger geiser-guile--enter-debugger)
+ (inferior-prompt-regexp geiser-guile--prompt-regexp)
+ (init-server-command geiser-guile--init-server-command)
(debugger-prompt-regexp geiser-guile--debugger-prompt-regexp)
- (debugger-preamble-regexp geiser-guile--debugger-preamble-regexp)
+ (enter-debugger geiser-guile--enter-debugger)
(marshall-procedure geiser-guile--geiser-procedure)
(find-module geiser-guile--get-module)
(enter-command geiser-guile--enter-command)
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el
index 4fd0952..f3aa7e5 100644
--- a/elisp/geiser-racket.el
+++ b/elisp/geiser-racket.el
@@ -244,7 +244,6 @@ using start-geiser, a procedure in the geiser/server module."
(binary geiser-racket--binary)
(arglist geiser-racket--parameters)
(init-server-command geiser-racket--init-server-command)
- (startup)
(prompt-regexp geiser-racket--prompt-regexp)
(marshall-procedure geiser-racket--geiser-procedure)
(find-module geiser-racket--get-module)
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 9136db5..2117ff1 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -118,7 +118,7 @@ expression for this implementation's geiser scheme prompt.")
"A variable (or thunk returning a value) giving the regular
expression for this implementation's debugging prompt.")
-(geiser-impl--define-caller geiser-repl--startup startup ()
+(geiser-impl--define-caller geiser-repl--startup repl-startup (remote)
"Function taking no parameters that is called after the REPL
has been initialised. All Geiser functionality is available to
you at that point.")
@@ -264,7 +264,7 @@ module command as a string")
(geiser-repl--history-setup)
(add-to-list 'geiser-repl--repls (current-buffer))
(geiser-repl--set-this-buffer-repl (current-buffer))
- (geiser-repl--startup impl)
+ (geiser-repl--startup impl remote)
(message "%s up and running!" (geiser-repl--repl-name impl))))
(defun geiser-repl--connection ()
@@ -599,7 +599,7 @@ With a prefix argument, force exit by killing the scheme process."
(with-current-buffer repl
(push (cons geiser-impl--implementation
(when geiser-repl--remote-p
- (list geiser-repl--host geiser-repl--port)))
+ (list (geiser-repl--host) (geiser-repl--port))))
lst))))))
(defun geiser-repl--restore (impls)