summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-05-16 00:01:21 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-05-16 00:01:21 +0200
commit2b0aefb48c0a4fec12466122d9b54b1894824ee3 (patch)
tree34cb87cef7a30c7d2e3ce1c03f1450629ad179d8
parent50d81a75a81994e09b4fa52d1e34bef45ac21f9c (diff)
downloadgeiser-guile-2b0aefb48c0a4fec12466122d9b54b1894824ee3.tar.gz
geiser-guile-2b0aefb48c0a4fec12466122d9b54b1894824ee3.tar.bz2
PLT: Correct identification of explicit module definitions.
-rw-r--r--elisp/geiser-plt.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/elisp/geiser-plt.el b/elisp/geiser-plt.el
index 16c0b96..7c66682 100644
--- a/elisp/geiser-plt.el
+++ b/elisp/geiser-plt.el
@@ -95,9 +95,16 @@ This function uses `geiser-plt-init-file' if it exists."
(ignore-errors
(car (read-from-string (match-string-no-properties 1)))))))
+(defsubst geiser-plt--implicit-module ()
+ (save-excursion
+ (goto-char (point-min))
+ (if (re-search-forward "^#lang " nil t)
+ (buffer-name)
+ :f)))
+
(defun geiser-plt-get-module (&optional module)
(cond ((and (null module) (geiser-plt--explicit-module)))
- ((null module) (buffer-file-name))
+ ((null module) (geiser-plt--implicit-module))
((symbolp module) (list 'quote module))
((and (stringp module) (file-name-absolute-p module)) module)
((stringp module) (list 'quote (intern module)))