From b4e68d4cad62cc8ac093dd2f7c07671c7b9ee3db Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Tue, 17 Mar 2009 13:36:40 +0100 Subject: Misc nits and work in progress. --- elisp/geiser-debug.el | 2 +- elisp/geiser-impl.el | 3 +++ elisp/geiser-larceny.el | 17 +++++++++++++++-- elisp/geiser-repl.el | 1 + elisp/geiser.el | 9 ++++++++- 5 files changed, 28 insertions(+), 4 deletions(-) (limited to 'elisp') 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-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: -- cgit v1.2.3