summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2011-06-23 01:29:09 +0200
committerjao <jao@gnu.org>2011-06-23 01:29:09 +0200
commit1421a7172cd41e3660a5f2eab23b32bb652ebaf9 (patch)
tree3e9534fb6b65a2cf197cf93294ad3242286de423
parentb9a89803f260af99451432db7372628d8889d179 (diff)
downloadgeiser-guile-1421a7172cd41e3660a5f2eab23b32bb652ebaf9.tar.gz
geiser-guile-1421a7172cd41e3660a5f2eab23b32bb652ebaf9.tar.bz2
Guile: find module when cursor is before define-module (#33497)
If we didn't find a define-module form after the cursor, or an enclosing R6RS library form, we search forward for a module definition. That way, things like C-c C-a work also from the top of the file.
-rw-r--r--elisp/geiser-guile.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index 648c64e..da14b4e 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -162,7 +162,8 @@ This function uses `geiser-guile-init-file' if it exists."
(while (not (zerop (geiser-syntax--nesting-level)))
(backward-up-list)))
(if (or (re-search-backward geiser-guile--module-re nil t)
- (looking-at geiser-guile--library-re))
+ (looking-at geiser-guile--library-re)
+ (re-search-forward geiser-guile--module-re nil t))
(geiser-guile--get-module (match-string-no-properties 1))
:f)))
((listp module) module)