summaryrefslogtreecommitdiff
path: root/elisp/geiser-gambit.el
diff options
context:
space:
mode:
authormathieu2em <math.per@hotmail.com>2019-07-31 13:18:28 -0400
committermathieu2em <math.per@hotmail.com>2019-08-20 15:31:38 -0400
commit6381b39aab1cdbac16184a963d542acf33875753 (patch)
tree662b7d99307399544f4c8bf49937d563b6fcbb45 /elisp/geiser-gambit.el
parent47e462db1a8875c362479d609c3efd5e82b0f782 (diff)
downloadgeiser-guile-6381b39aab1cdbac16184a963d542acf33875753.tar.gz
geiser-guile-6381b39aab1cdbac16184a963d542acf33875753.tar.bz2
better indent , gsi opening param using module if > version 4.9.3
Diffstat (limited to 'elisp/geiser-gambit.el')
-rw-r--r--elisp/geiser-gambit.el32
1 files changed, 18 insertions, 14 deletions
diff --git a/elisp/geiser-gambit.el b/elisp/geiser-gambit.el
index b7ac830..cd68e46 100644
--- a/elisp/geiser-gambit.el
+++ b/elisp/geiser-gambit.el
@@ -32,7 +32,7 @@
(eval-when-compile (require 'cl))
(defconst geiser-gambit--builtin-keywords
- '("##debug-repl" "##import"))
+ '("##debug-repl" "##import" "define-macro" "##symbol-table" "##decompile"))
;;; Customization
@@ -97,10 +97,6 @@ this variable to t."
(car geiser-gambit-binary)
geiser-gambit-binary))
-(defun geiser-gambit--parameters ()
- "Return a list with all parameters needed to start Gambit Scheme."
- `( ,(expand-file-name "gambit/geiser/gambit.scm" geiser-scheme-dir) "-" ))
-
(defconst geiser-gambit--prompt-regexp "> ")
(defconst geiser-gambit--debugger-prompt-regexp "[0-9]+> ")
@@ -122,7 +118,8 @@ If `t', Geiser will use `next-error' to jump to the error's location."
:type 'boolean
:group 'geiser-gambit)
-;;; Evaluation support:
+;;; evaluation support when module loaded at opening
+;;; the gambit/geiser# is the namespace of geiser module for gambit
(defun geiser-gambit--geiser-procedure (proc &rest args)
(case proc
((eval compile)
@@ -134,15 +131,15 @@ If `t', Geiser will use `next-error' to jump to the error's location."
(concat "'" (car args)))
(t
"#f")))
- (cmd (format "(geiser:eval %s '%s)" module form)))
+ (cmd (format "(gambit/geiser#geiser:eval %s '%s)" module form)))
cmd))
((load-file compile-file)
- (format "(geiser:load-file %s)" (car args)))
+ (format "(gambit/geiser#geiser:load-file %s)" (car args)))
((no-values)
- "(geiser:no-values)")
+ "(gambit/geiser#geiser:no-values)")
(t
(let ((form (mapconcat 'identity args " ")))
- (format "(geiser:%s %s)" proc form)))))
+ (format "(gambit/geiser#geiser:%s %s)" proc form)))))
;;(defconst geiser-gambit--module-re
;; "( *module +\\(([^)]+)\\|[^ ]+\\)\\|( *define-library +\\(([^)]+)\\|[^ ]+\\)")
@@ -184,9 +181,6 @@ If `t', Geiser will use `next-error' to jump to the error's location."
(defun geiser-gambit--symbol-begin (module)
(save-excursion (skip-syntax-backward "^-()> ") (point)))
-(defun geiser-gambit--version (binary)
- (car (process-lines binary "-c" "(display (version))")))
-
(defun connect-to-gambit ()
"Start a gambit REPL connected to a remote process."
(interactive)
@@ -285,7 +279,6 @@ If `t', Geiser will use `next-error' to jump to the error's location."
(define-record 1)
(define-specialization 1)
(define-type 1)
- (with-input-from-pipe 1)
(select 1)
(functor 3)
(define-interface 1)
@@ -299,6 +292,17 @@ If `t', Geiser will use `next-error' to jump to the error's location."
(shell-command-to-string (format "%s -e \"(display (##system-version-string))\""
binary)))
+(defun geiser-gambit--parameters ()
+ "Return a list with all parameters needed to start Gambit Scheme."
+ ;; if your version of gambit support modules we directly load geiser module
+ ;; else we go load the file in geiser
+ (let* ((v (geiser-gambit--version (geiser-gambit--binary)))
+ (gambit-version (substring v 1 (string-width v))))
+ (if (version< gambit-version "4.9.3")
+ `( ,(expand-file-name "gambit/geiser/gambit" geiser-scheme-dir) "-" )
+ `( "gambit/geiser" "-"))))
+
+
(defun connect-to-gambit ()
"Start a Gambit REPL connected to a remote process."
(interactive)