diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-01 20:40:22 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-01 20:40:22 +0100 |
commit | 28e79842fd87689187834a2c4186b5e2ac294fe6 (patch) | |
tree | 6ef1349dea39bb9688c7a4a2e95969ef7fece7c9 /elisp/geiser-mode.el | |
parent | c5d4a2b6670a9f3ce8b357ef5f4cab72eb211102 (diff) | |
download | geiser-chez-28e79842fd87689187834a2c4186b5e2ac294fe6.tar.gz geiser-chez-28e79842fd87689187834a2c4186b5e2ac294fe6.tar.bz2 |
Macro-expand commands.
Diffstat (limited to 'elisp/geiser-mode.el')
-rw-r--r-- | elisp/geiser-mode.el | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el index fbbcff4..6a3df40 100644 --- a/elisp/geiser-mode.el +++ b/elisp/geiser-mode.el @@ -108,6 +108,28 @@ With prefix, goes to the REPL buffer afterwards (as (interactive) (geiser-compile-definition t)) +(defun geiser-expand-region (start end &optional all) + "Macro-expand the current region and display it in a buffer. +With prefix, recursively macro-expand the resulting expression." + (interactive "rP") + (geiser-debug--expand-region start end all)) + +(defun geiser-expand-definition (&optional all) + "Macro-expand the current definition. +With prefix, recursively macro-expand the resulting expression." + (interactive "P") + (save-excursion + (end-of-defun) + (let ((end (point))) + (beginning-of-defun) + (geiser-expand-region (point) end all)))) + +(defun geiser-expand-last-sexp (&optional all) + "Macro-expand the previous sexp. +With prefix, recursively macro-expand the resulting expression." + (interactive "P") + (geiser-expand-region (save-excursion (backward-sexp) (point)) (point) all)) + ;;; Geiser mode: @@ -166,8 +188,9 @@ interacting with the Geiser REPL is at your disposal. (geiser-mode--triple-chord ?e ?m 'geiser-edit-module) -(define-key geiser-mode-map "\C-c\C-t" 'geiser-trace-procedure) -(define-key geiser-mode-map "\C-c\C-x" 'geiser-expand-current-form) +(geiser-mode--triple-chord ?x ?e 'geiser-expand-last-sexp) +(geiser-mode--triple-chord ?x ?r 'geiser-expand-region) +(geiser-mode--triple-chord ?x ?x 'geiser-expand-definition) (provide 'geiser-mode) |