summaryrefslogtreecommitdiff
path: root/elisp/geiser-debug.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-03-01 20:40:22 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-03-01 20:40:22 +0100
commit28e79842fd87689187834a2c4186b5e2ac294fe6 (patch)
tree6ef1349dea39bb9688c7a4a2e95969ef7fece7c9 /elisp/geiser-debug.el
parentc5d4a2b6670a9f3ce8b357ef5f4cab72eb211102 (diff)
downloadgeiser-chez-28e79842fd87689187834a2c4186b5e2ac294fe6.tar.gz
geiser-chez-28e79842fd87689187834a2c4186b5e2ac294fe6.tar.bz2
Macro-expand commands.
Diffstat (limited to 'elisp/geiser-debug.el')
-rw-r--r--elisp/geiser-debug.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/elisp/geiser-debug.el b/elisp/geiser-debug.el
index 6393e7e..0bc3f85 100644
--- a/elisp/geiser-debug.el
+++ b/elisp/geiser-debug.el
@@ -106,6 +106,19 @@
(message (format "=> %s" (geiser-eval--retort-result ret)))
(geiser-debug--display-retort str ret))))
+(defun geiser-debug--expand-region (start end all)
+ (let* ((str (buffer-substring-no-properties start end))
+ (code `(:eval ((:ge macroexpand) (quote (:scm ,str)) ,(if all :t :f))))
+ (ret (geiser-eval--send/wait code))
+ (err (geiser-eval--retort-error ret)))
+ (if err
+ (geiser-debug--display-retort str ret)
+ (geiser-debug--with-buffer
+ (erase-buffer)
+ (insert (format "%s" (geiser-eval--retort-result ret)))
+ (goto-char (point-min)))
+ (geiser-debug--pop-to-buffer))))
+
(provide 'geiser-debug)
;;; geiser-debug.el ends here