diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-01 16:41:09 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-01 16:41:09 +0100 |
commit | af150090685e5e456bc0788fb45703b6eace053d (patch) | |
tree | 37c51fcac5362359c91bb7c2e791f3a9020b0e1c | |
parent | 3990c6476ab7cee03f4bf89827df7a23adf4d794 (diff) | |
download | geiser-guile-af150090685e5e456bc0788fb45703b6eace053d.tar.gz geiser-guile-af150090685e5e456bc0788fb45703b6eace053d.tar.bz2 |
Some refactoring and new ge:macroexpand.
-rw-r--r-- | elisp/geiser-debug.el | 7 | ||||
-rw-r--r-- | elisp/geiser-eval.el | 10 | ||||
-rw-r--r-- | elisp/geiser-mode.el | 21 | ||||
-rw-r--r-- | scheme/guile/geiser/emacs.scm | 5 |
4 files changed, 25 insertions, 18 deletions
diff --git a/elisp/geiser-debug.el b/elisp/geiser-debug.el index c67a6aa..20db436 100644 --- a/elisp/geiser-debug.el +++ b/elisp/geiser-debug.el @@ -92,6 +92,13 @@ (insert "In expression:\n")) (insert (format "%s%s\n" (make-string offset ?\ ) description)))) +(defun geiser-debug--send-region (compile start end and-go) + (let* ((ret (geiser-eval--send-region compile start end and-go)) + (err (geiser-eval--retort-error ret))) + (if (not err) + (message (format "=> %s" (geiser-eval--retort-result ret))) + (geiser-debug--display-retort str ret)))) + (provide 'geiser-debug) ;;; geiser-debug.el ends here diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el index 09f12da..ca0460f 100644 --- a/elisp/geiser-eval.el +++ b/elisp/geiser-eval.el @@ -117,6 +117,16 @@ (defsubst geiser-eval--send/result (code &optional timeout buffer) (geiser-eval--retort-result (geiser-eval--send/wait code timeout buffer))) +(defun geiser-eval--send-region (compile start end and-go) + (let* ((str (buffer-substring-no-properties start end)) + (code `(,(if compile :comp :eval) (:scm ,str))) + (ret (geiser-eval--send/wait code))) + (when and-go + (switch-to-guile) + (push-mark) + (goto-char (point-max))) + ret)) + ;;; Retort parsing: diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el index a03c70e..fbbcff4 100644 --- a/elisp/geiser-mode.el +++ b/elisp/geiser-mode.el @@ -33,6 +33,7 @@ (require 'geiser-debug) (require 'geiser-eval) (require 'geiser-repl) +(require 'geiser-popup) (require 'geiser-custom) (require 'geiser-base) @@ -56,22 +57,6 @@ -;;; Auxiliary functions: - -(defun geiser-eval--send-region (compile start end and-go) - (let* ((str (buffer-substring-no-properties start end)) - (code `(,(if compile :comp :eval) (:scm ,str))) - (ret (geiser-eval--send/wait code)) - (err (geiser-eval--retort-error ret))) - (when and-go - (switch-to-guile) - (push-mark) - (goto-char (point-max))) - (if (not err) - (message (format "=> %s" (geiser-eval--retort-result ret))) - (geiser-debug--display-retort str ret)))) - - ;;; Evaluation commands: (defun geiser-eval-region (start end &optional and-go) @@ -79,7 +64,7 @@ With prefix, goes to the REPL buffer afterwards (as `geiser-eval-region-and-go')" (interactive "rP") - (geiser-eval--send-region nil start end and-go)) + (geiser-debug--send-region nil start end and-go)) (defun geiser-eval-region-and-go (start end) "Eval the current region in the Geiser REPL and visit it afterwads." @@ -116,7 +101,7 @@ With prefix, goes to the REPL buffer afterwards (as (end-of-defun) (let ((end (point))) (beginning-of-defun) - (geiser-eval--send-region t (point) end and-go)))) + (geiser-debug--send-region t (point) end and-go)))) (defun geiser-compile-definition-and-go () "Compile the current definition in the Geiser REPL and visit it afterwads." diff --git a/scheme/guile/geiser/emacs.scm b/scheme/guile/geiser/emacs.scm index 7f03be8..66320ec 100644 --- a/scheme/guile/geiser/emacs.scm +++ b/scheme/guile/geiser/emacs.scm @@ -27,6 +27,7 @@ (define-module (geiser emacs) #:export (ge:eval ge:compile + ge:macroexpand ge:compile-file ge:load-file) #:re-export (ge:autodoc @@ -141,4 +142,8 @@ "Load file, given its full @var{path}." (evaluate `(load ,path) #f eval)) +(define (ge:macroexpand form . all) + (let ((all (and (not (null? all)) (car all)))) + ((if all macroexpand macroexpand-1) form))) + ;;; emacs.scm ends here |