summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--elisp/geiser-debug.el2
-rw-r--r--elisp/geiser-guile.el2
-rw-r--r--elisp/geiser-impl.el3
-rw-r--r--elisp/geiser-larceny.el17
-rw-r--r--elisp/geiser-repl.el1
-rw-r--r--elisp/geiser.el9
6 files changed, 29 insertions, 5 deletions
diff --git a/elisp/geiser-debug.el b/elisp/geiser-debug.el
index 35b81ca..dbebc35 100644
--- a/elisp/geiser-debug.el
+++ b/elisp/geiser-debug.el
@@ -98,7 +98,7 @@
(ret (geiser-eval--send/wait code))
(err (geiser-eval--retort-error ret)))
(when and-go
- (switch-to-guile)
+ (switch-to-geiser)
(push-mark)
(goto-char (point-max)))
(if (not err)
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index a34e4d6..d3928b4 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -102,7 +102,7 @@ If MODULE is provided, transform it to such a datum."
(defun geiser-guile-guess ()
"Return `t' if the current buffer looks like a Guile file."
- (and (geiser-guile-get-module) t))
+ (listp (geiser-guile-get-module)))
;;; Register this implementation:
diff --git a/elisp/geiser-impl.el b/elisp/geiser-impl.el
index cdda479..312ace9 100644
--- a/elisp/geiser-impl.el
+++ b/elisp/geiser-impl.el
@@ -167,6 +167,9 @@
(or (geiser-impl--call-if-bound impl "prompt-regexp")
(geiser-impl--value impl "prompt-regexp")))
+(defsubst geiser-impl--startup (impl)
+ (geiser-impl--call-if-bound impl "startup"))
+
;;; Access to implementation guessing function:
diff --git a/elisp/geiser-larceny.el b/elisp/geiser-larceny.el
index f010cfb..7cc3816 100644
--- a/elisp/geiser-larceny.el
+++ b/elisp/geiser-larceny.el
@@ -24,6 +24,7 @@
;;; Code:
+(require 'geiser-eval)
(require 'geiser-impl)
(require 'geiser-syntax)
(require 'geiser-custom)
@@ -44,15 +45,27 @@
:type 'string
:group 'geiser-larceny)
+(defcustom geiser-larceny-mode 'err5rs
+ "Mode to use when starting the Larceny REPL."
+ :type '(choice (const :tag "ERR5RS" err5rs)
+ (const :tag "R5RS" 'r5rs))
+ :group 'geiser-larceny)
+
;;; REPL support:
(defun geiser-larceny-parameters ()
"Return a list with all parameters needed to start Larceny."
- `("-err5rs" "-path" ,(expand-file-name "larceny/" geiser-scheme-dir)))
+ `(,(if (eq 'r5rs geiser-larceny-mode) "-r5rs" "-err5rs")
+ "-path" ,(expand-file-name "larceny/" geiser-scheme-dir)))
(defconst geiser-larceny-prompt-regexp "^\\(debug\\)?> ")
+(defun geiser-larceny--startup ()
+ (when (eq 'err5rs geiser-larceny-mode)
+ (geiser-eval--send/wait '(import (rnrs))))
+ (geiser-eval--send/wait '(require (geiser))))
+
(defun switch-to-larceny (&optional ask)
(interactive "P")
(switch-to-geiser ask 'larceny))
@@ -92,7 +105,7 @@ If MODULE is provided, transform it to such a datum."
(defun geiser-larceny-guess ()
"Return `t' if the current buffer looks like a Larceny file."
- (and (geiser-larceny-get-module) t))
+ (listp (geiser-larceny-get-module)) t)
;;; Register this implementation:
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index d0eddd5..2ea3b33 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -131,6 +131,7 @@ implementation name gets appended to it."
(geiser-repl--history-setup)
(geiser-con--setup-connection (current-buffer) prompt-rx)
(add-to-list 'geiser-repl--repls (current-buffer))
+ (geiser-impl--startup impl)
(geiser-repl--set-this-buffer-repl (current-buffer))))
(defun geiser-repl--process ()
diff --git a/elisp/geiser.el b/elisp/geiser.el
index 4c1a16e..6559b95 100644
--- a/elisp/geiser.el
+++ b/elisp/geiser.el
@@ -72,7 +72,14 @@
(mapc (lambda (group)
(custom-add-load group (symbol-name group))
(custom-add-load 'geiser (symbol-name group)))
- '(geiser geiser-repl geiser-autodoc geiser-doc geiser-faces geiser-mode))
+ '(geiser
+ geiser-repl
+ geiser-autodoc
+ geiser-doc
+ geiser-faces
+ geiser-mode
+ geiser-guile
+ geiser-larceny))
;;; Scheme mode setup: