diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-01 01:45:58 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-01 01:45:58 +0100 |
commit | ea42746970657bc05b31c462a01df21d079e4a9e (patch) | |
tree | 97aca161ce242cfc54ac89d0ea1131126c52b855 | |
parent | e3edc4db496c012da1cf4d406b94bd752ea79622 (diff) | |
download | geiser-guile-ea42746970657bc05b31c462a01df21d079e4a9e.tar.gz geiser-guile-ea42746970657bc05b31c462a01df21d079e4a9e.tar.bz2 |
Guile: better meta-command args handling
-rw-r--r-- | elisp/geiser-guile.el | 26 | ||||
-rw-r--r-- | scheme/guile/geiser/emacs.scm | 2 |
2 files changed, 6 insertions, 22 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el index f0d090d..93d1237 100644 --- a/elisp/geiser-guile.el +++ b/elisp/geiser-guile.el @@ -113,34 +113,18 @@ This function uses `geiser-guile-init-file' if it exists." ;;; Evaluation support: -(defun geiser-guile--linearize (str) - (if (string-match "\n" str) - (with-temp-buffer - (set-syntax-table scheme-mode-syntax-table) - (insert str) - (goto-char (point-min)) - (let ((kill-whole-line nil)) - (while (> (skip-syntax-forward "^<") 0) - (let ((p (point))) - (end-of-line) - (kill-region p (point))))) - (goto-char (point-min)) - (while (search-forward-regexp "\n[ \t\r\n]*" nil t) - (replace-match " ")) - (buffer-string)) - str)) - (defsubst geiser-guile--linearize-args (args) - (mapconcat 'geiser-guile--linearize args " ")) + (mapconcat 'identity args " ")) (defun geiser-guile--geiser-procedure (proc &rest args) (case proc - ((eval compile) (format ",geiser-eval %s %s" + ((eval compile) (format ",geiser-eval %s %s%s" (or (car args) "#f") - (geiser-guile--linearize-args (cdr args)))) + (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))))) + (t (format "ge:%s (%s)" proc (geiser-guile--linearize-args args))))) (defconst geiser-guile--module-re "(define-module +\\(([^)]+)\\)") diff --git a/scheme/guile/geiser/emacs.scm b/scheme/guile/geiser/emacs.scm index 73c02d0..54e5d34 100644 --- a/scheme/guile/geiser/emacs.scm +++ b/scheme/guile/geiser/emacs.scm @@ -26,7 +26,7 @@ No-op command used internally by Geiser." (values)) -(define-meta-command ((geiser-eval geiser) repl mod form . args) +(define-meta-command ((geiser-eval geiser) repl (mod form args) . rest) "geiser-eval Meta-command used by Geiser to evaluate and compile code." (if (null? args) |