From 3670817dcc482c75105da7965e7306044171b0d9 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 8 Feb 2009 12:47:42 +0100 Subject: Fixes for Elisp/Scheme translations. --- elisp/geiser-connection.el | 10 ++++++++-- elisp/geiser-eval.el | 15 +++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/elisp/geiser-connection.el b/elisp/geiser-connection.el index 8091c84..060ab7b 100644 --- a/elisp/geiser-connection.el +++ b/elisp/geiser-connection.el @@ -156,14 +156,20 @@ (defsubst geiser-con--comint-buffer () (get-buffer-create " *geiser connection retort*")) +(defun geiser-con--cleaunp-result-str () + (goto-char (point-min)) + (while (re-search-forward "#(" nil t) (replace-match "(vector ")) + (goto-char (point-min)) + (while (re-search-forward "#" nil t) (replace-match "\\\\#"))) + (defun geiser-con--comint-buffer-form () (with-current-buffer (geiser-con--comint-buffer) - (replace-string "#" ":" nil (point-min) (point-max)) + (geiser-con--cleaunp-result-str) (goto-char (point-min)) (condition-case nil (let ((form (read (current-buffer)))) (if (listp form) form (error))) - (error `((error geiser-con-error ,(buffer-string))))))) + (error `((error (key . geiser-con-error) (msg . ,(buffer-string)))))))) (defun geiser-con--process-next (con) (when (not (geiser-con--connection-current-request con)) diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el index 8466a36..5369a1f 100644 --- a/elisp/geiser-eval.el +++ b/elisp/geiser-eval.el @@ -37,16 +37,19 @@ ((eq code :f) "#f") ((eq code :t) "#t") ((listp code) - (cond ((eq (car code) :gs) (concat "((@ (geiser eval) eval-in) (quote " - (geiser-eval--scheme-str (nth 1 code)) - ") " - (or (nth 2 code) - (geiser-eval--buffer-module)) - ")")) + (cond ((eq (car code) :gs) (geiser-eval--gs (cdr code))) ((eq (car code) :scm) (cadr code)) (t (concat "(" (mapconcat 'geiser-eval--scheme-str code " ") ")")))) (t (format "%S" code)))) +(defsubst geiser-eval--gs (code) + (concat "((@ (geiser eval) eval-in) (quote " + (geiser-eval--scheme-str (nth 0 code)) + ") (quote " + (or (and (nth 1 code) + (geiser-eval--scheme-str (nth 1 code))) + (geiser-eval--buffer-module)) + "))")) ;;; Current module: -- cgit v1.2.3