From 91cb3fe32e5d2a93abb30c7f887e0a4c52ee6aae Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sat, 16 May 2009 00:01:21 +0200 Subject: PLT: Correct identification of explicit module definitions. --- elisp/geiser-plt.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'elisp') 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))) -- cgit v1.2.3