summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--elisp/geiser-guile.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index 93d1237..f410674 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -144,8 +144,9 @@ This function uses `geiser-guile-init-file' if it exists."
:f)))
((listp module) module)
((stringp module)
- (or (ignore-errors (car (geiser-syntax--read-from-string module)))
- :f))
+ (condition-case nil
+ (car (geiser-syntax--read-from-string module))
+ (error :f)))
(t :f)))
(defun geiser-guile--module-cmd (module fmt &optional def)
@@ -198,10 +199,14 @@ This function uses `geiser-guile-init-file' if it exists."
;;; Trying to ascertain whether a buffer is Guile Scheme:
+(defconst geiser-guile--guess-re
+ (format "\\(%s\\|#! *.+\\(/\\| \\)guile\\( *\\\\\\)?\\)"
+ geiser-guile--module-re))
+
(defun geiser-guile--guess ()
(save-excursion
(goto-char (point-min))
- (re-search-forward geiser-guile--module-re nil t)))
+ (re-search-forward geiser-guile--guess-re nil t)))
;;; Compilation shell regexps