summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2013-08-25 07:12:07 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-08-25 07:12:07 +0200
commit2a903ff81c1696a05d99bc78ebc9558f64b41c81 (patch)
treea7d0cb5f4a7929cdba277b01685c1a550f6b4346
parentf417431b8b72fbc6e98c1310b99cba50882b13d2 (diff)
downloadgeiser-2a903ff81c1696a05d99bc78ebc9558f64b41c81.tar.gz
geiser-2a903ff81c1696a05d99bc78ebc9558f64b41c81.tar.bz2
Let's make it *any* submodule
So the new functions are named geiser-racket-*-submodules, and by default all submodule forms are hidden. Now that we have the helpers in geiser-edit, we could have a generic command in geiser-mode to change the visibility of form at point.
-rw-r--r--NEWS4
-rw-r--r--elisp/geiser-edit.el6
2 files changed, 7 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 5f3b250..b3770fe 100644
--- a/NEWS
+++ b/NEWS
@@ -2,8 +2,8 @@
New features:
- - Racket: new commands geiser-racket-{show, hide, toggle}-tests,
- for hiding test modules in code buffers.
+ - Racket: new commands geiser-racket-{show, hide, toggle}-submodules,
+ for folding submodule forms in code buffers.
- Racket: interaction with submodules (entering them and evaluation
within their scope).
- New commands geiser-eval-buffer (C-c C-b) and
diff --git a/elisp/geiser-edit.el b/elisp/geiser-edit.el
index f75e303..d43cf9b 100644
--- a/elisp/geiser-edit.el
+++ b/elisp/geiser-edit.el
@@ -191,7 +191,7 @@ or following links in error buffers.")
(let ((cloak (geiser-edit--cloak form)))
(save-excursion
(goto-char (point-min))
- (while (re-search-forward (format "(%s\\b" (regexp-quote form)) nil t)
+ (while (re-search-forward (format "(%s\\b" form) nil t)
(let* ((beg (match-beginning 0))
(end (progn (ignore-errors (goto-char beg) (forward-sexp))
(point))))
@@ -204,6 +204,10 @@ or following links in error buffers.")
(remove-overlays nil nil 'invisible cloak)
(remove-from-invisibility-spec (cons cloak t))))
+(defun geiser-edit--show-all ()
+ (remove-overlays)
+ (setq buffer-invisibility-spec '(t)))
+
(defun geiser-edit--toggle-visibility (form)
(if (and (listp buffer-invisibility-spec)
(assoc (geiser-edit--cloak form) buffer-invisibility-spec))