summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-09-15 00:30:06 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-09-15 00:30:06 +0200
commit236ec5f042d70836db8eeba819b528989b477fac (patch)
treea6292661b0e26320941c3ed229b5a88c6580e7bb /elisp
parent387d557d779f634d16683d81363094063248183f (diff)
downloadgeiser-guile-236ec5f042d70836db8eeba819b528989b477fac.tar.gz
geiser-guile-236ec5f042d70836db8eeba819b528989b477fac.tar.bz2
Guile: define-module forms are now individually evaluable (e.g. using C-M-x or C-x C-e).
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-guile.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index 849fabf..fca4b01 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -95,8 +95,11 @@ This function uses `geiser-guile-init-file' if it exists."
(defun geiser-guile-get-module (&optional module)
(cond ((null module)
(save-excursion
- (goto-char (point-min))
- (if (re-search-forward geiser-guile--module-re nil t)
+ (ignore-errors
+ (backward-sexp)
+ (while (not (zerop (geiser-syntax--nesting-level)))
+ (backward-up-list)))
+ (if (re-search-backward geiser-guile--module-re nil t)
(geiser-guile-get-module (match-string-no-properties 1))
:f)))
((listp module) module)
@@ -152,9 +155,9 @@ This function uses `geiser-guile-init-file' if it exists."
;;; Trying to ascertain whether a buffer is Guile Scheme:
(defun geiser-guile-guess ()
- "Return `t' if the current buffer looks like a Guile file."
- (listp (geiser-guile-get-module)))
-
+ (save-excursion
+ (goto-char (point-min))
+ (re-search-forward geiser-guile--module-re nil t)))
(provide 'geiser-guile)
;;; geiser-guile.el ends here