diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-12 01:33:09 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-12 01:33:09 +0100 |
commit | dc8155b5d0e5c533a1fc6cb64399e8cccd7c1716 (patch) | |
tree | 630f0ac4050f3f4179e0a8402f3b0e88c539b012 /elisp/geiser-guile.el | |
parent | 24fe735860a68542bb569bb59c712995f7bd1deb (diff) | |
download | geiser-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/geiser-guile.el')
-rw-r--r-- | elisp/geiser-guile.el | 37 |
1 files changed, 23 insertions, 14 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) |