summaryrefslogtreecommitdiff
path: root/elisp/geiser-eval.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-02-09 01:29:26 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-02-09 01:29:26 +0100
commit4e7c148fef58281345c1d4d0815732e27977da71 (patch)
tree22ed1c67b6fecd2c0bd024a6a04e897e2e105f59 /elisp/geiser-eval.el
parente16e29baa9d444be4fd5e60f93c124c666c60b80 (diff)
downloadgeiser-chez-4e7c148fef58281345c1d4d0815732e27977da71.tar.gz
geiser-chez-4e7c148fef58281345c1d4d0815732e27977da71.tar.bz2
Basic region/definition/sexp evaluation and autodoc mode working.
Diffstat (limited to 'elisp/geiser-eval.el')
-rw-r--r--elisp/geiser-eval.el27
1 files changed, 15 insertions, 12 deletions
diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el
index 68ef1ca..ee04139 100644
--- a/elisp/geiser-eval.el
+++ b/elisp/geiser-eval.el
@@ -26,6 +26,7 @@
;;; Code:
(require 'geiser-connection)
+(require 'geiser-syntax)
(require 'geiser-log)
(require 'geiser-base)
@@ -38,8 +39,10 @@
((eq code :t) "#t")
((listp code)
(cond ((eq (car code) :gs) (geiser-eval--gs (cdr code)))
+ ((eq (car code) :ge) (format "(@ (geiser emacs) %s)" (cadr code)))
((eq (car code) :scm) (cadr code))
(t (concat "(" (mapconcat 'geiser-eval--scheme-str code " ") ")"))))
+ ((symbolp code) (format "%s" code))
(t (format "%S" code))))
(defsubst geiser-eval--gs (code)
@@ -48,19 +51,8 @@
") (quote "
(or (and (nth 1 code)
(geiser-eval--scheme-str (nth 1 code)))
- (geiser-eval--buffer-module))
+ (geiser-syntax--buffer-module))
"))"))
-
-;;; Current module:
-
-(defun geiser-eval--buffer-module (&optional buffer)
- (let ((buffer (or buffer (current-buffer))))
- (with-current-buffer buffer
- (save-excursion
- (goto-char (point-min))
- (if (re-search-forward "(define-module +\\(([^)]+)\\)" nil t)
- (match-string-no-properties 1)
- "#f")))))
;;; Code sending:
@@ -116,6 +108,17 @@
(defsubst geiser-eval--error-msg (err) (cdr (assoc 'msg err)))
(defsubst geiser-eval--error-rest (err) (cdr (assoc 'rest err)))
+(defun geiser-eval--error-str (err)
+ (let* ((key (geiser-eval--error-key err))
+ (subr (geiser-eval--error-subr err))
+ (subr-str (if subr (format " (%s)" subr) ""))
+ (msg (geiser-eval--error-msg err))
+ (msg-str (if msg (format ": %s" msg) ""))
+ (rest (geiser-eval--error-rest err))
+ (rest-str (if rest (format " %s" rest) "")))
+ (format "Error%s: %s%s%s" subr-str key msg-str rest-str)))
+
+
(provide 'geiser-eval)
;;; geiser-eval.el ends here