summaryrefslogtreecommitdiff
path: root/elisp/geiser-racket.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2013-08-25 06:22:05 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-08-25 06:22:05 +0200
commit79d3a9a2f332f71711734ee5dd1b7fb2c45ca797 (patch)
tree1778151236bb62c789fc824f2f665fb1c171710e /elisp/geiser-racket.el
parentceb418aff619db01c5ed1201abff75df41a35102 (diff)
downloadgeiser-guile-79d3a9a2f332f71711734ee5dd1b7fb2c45ca797.tar.gz
geiser-guile-79d3a9a2f332f71711734ee5dd1b7fb2c45ca797.tar.bz2
Racket: new commands to show and hide test submodules
The new commands, being racket-specific, are called geiser-racket-{show,hide,toggle}-tests, and have no default binding in geiser-mode (since they don't have any meaning in Guile). The implementation is based on more generic functions in geiser-edit that allow hiding of any top-level form, given its name, so we will probably find new forms to hide in the future. Hiding is limited to top-level forms, which i think is fine for the only use case we have in mind right now.
Diffstat (limited to 'elisp/geiser-racket.el')
-rw-r--r--elisp/geiser-racket.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el
index 4fbc017..9e00c4d 100644
--- a/elisp/geiser-racket.el
+++ b/elisp/geiser-racket.el
@@ -370,6 +370,27 @@ using start-geiser, a procedure in the geiser/server module."
(setq geiser-image-cache-dir
(geiser-eval--send/result '(:eval (image-cache) geiser/user)))))
+
+;;; Additional commands
+
+(defconst geiser-racket--test-module "module+ test")
+
+(defun geiser-racket-toggle-tests ()
+ "Toggle visibility of test module fragments of the form (module+ test).
+
+When hidden, the test module forms are shown as an ellipsis."
+ (interactive)
+ (geiser-edit--toggle-visibility geiser-racket--test-module))
+
+(defun geiser-racket-show-tests ()
+ "Unconditionally shows all test modules."
+ (interactive)
+ (geiser-edit--show geiser-racket--test-module))
+
+(defun geiser-racket-hide-tests ()
+ "Unconditionally hides all visible test modules."
+ (interactive)
+ (geiser-edit--hide geiser-racket--test-module))
;;; Implementation definition: