summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-11 16:28:52 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-11 16:28:52 +0100
commit9889d2900b01e9fe400e79efbd6935ad7e7d4bdf (patch)
treec749d9cb614cb1e0b4b1881d76091ae3a9fb0d81 /elisp
parent7082042d262ee3d82ebe32d16f3593418b06f454 (diff)
parentbc806390fa0477e957456d020e5e27ad104520ed (diff)
downloadgeiser-guile-9889d2900b01e9fe400e79efbd6935ad7e7d4bdf.tar.gz
geiser-guile-9889d2900b01e9fe400e79efbd6935ad7e7d4bdf.tar.bz2
Merge branch 'guile-meta' into meta-reconnection
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-guile.el30
1 files changed, 18 insertions, 12 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index d58821b..3979688 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -113,28 +113,33 @@ This function uses `geiser-guile-init-file' if it exists."
;;; Evaluation support:
+(defsubst geiser-guile--linearize-args (args)
+ (mapconcat 'identity args " "))
(defun geiser-guile--geiser-procedure (proc &rest args)
(case proc
- ((eval compile) (format "((@ (geiser emacs) ge:compile) '%s '%s)"
- (mapconcat 'identity (cdr args) " ")
- (or (car args) "#f")))
- ((load-file compile-file)
- (format "((@ (geiser emacs) ge:%s) %s)" proc (car args)))
- ((no-values) "((@ (guile) values))")
- (t (format "(apply (@ (geiser emacs) ge:%s) (list %s))"
- proc (mapconcat 'identity args "")))))
+ ((eval compile) (format ",geiser-eval %s %s%s"
+ (or (car args) "#f")
+ (geiser-guile--linearize-args (cdr args))
+ (if (cddr args) "" " ()")))
+ ((load-file compile-file) (format ",geiser-load-file %s" (car args)))
+ ((no-values) ",geiser-no-values")
+ (t (format "ge:%s (%s)" proc (geiser-guile--linearize-args args)))))
(defconst geiser-guile--module-re
"(define-module +\\(([^)]+)\\)")
+(defconst geiser-guile--library-re
+ "(library +\\(([^)]+)\\)")
+
(defun geiser-guile--get-module (&optional module)
(cond ((null module)
(save-excursion
(ignore-errors
(while (not (zerop (geiser-syntax--nesting-level)))
(backward-up-list)))
- (if (re-search-backward geiser-guile--module-re nil t)
+ (if (or (re-search-backward geiser-guile--module-re nil t)
+ (looking-at geiser-guile--library-re))
(geiser-guile--get-module (match-string-no-properties 1))
:f)))
((listp module) module)
@@ -174,7 +179,7 @@ This function uses `geiser-guile-init-file' if it exists."
(if geiser-guile-debug-show-bt-p "bt" "fr"))))
(compilation-forget-errors)
(goto-char (point-max))
- (comint-send-string nil "((@ (geiser emacs) ge:newline))\n")
+ (comint-send-string nil ",geiser-newline\n")
(comint-send-string nil ",error-message\n")
(comint-send-string nil bt-cmd)
(when geiser-guile-show-debug-help-p
@@ -252,8 +257,9 @@ it spawn a server thread."
`((,geiser-guile--path-rx 1
compilation-error-face)))
(geiser-eval--send/wait
- `(:scm ,(format "(set! %%load-path (cons %S %%load-path))"
- (expand-file-name "guile/" geiser-scheme-dir))))
+ (format "(set! %%load-path (cons %S %%load-path))"
+ (expand-file-name "guile/" geiser-scheme-dir)))
+ (geiser-eval--send/wait ",use (geiser emacs)")
(geiser-guile-update-warning-level))