summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-09-26 04:25:13 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-09-26 04:25:13 +0200
commit37fa240e6d3a1ecfce4fbbe61e4c096793e1d216 (patch)
treea6cc2086352dab0486e51ea7ce226e06b389a975
parent512a61cfa6725deb530485b0e19a1010eeeec31d (diff)
downloadgeiser-37fa240e6d3a1ecfce4fbbe61e4c096793e1d216.tar.gz
geiser-37fa240e6d3a1ecfce4fbbe61e4c096793e1d216.tar.bz2
Letting implementations define their own file pattern matching rules.
-rw-r--r--elisp/geiser-impl.el8
-rw-r--r--elisp/geiser-plt.el3
2 files changed, 8 insertions, 3 deletions
diff --git a/elisp/geiser-impl.el b/elisp/geiser-impl.el
index a85b97b..2fb0828 100644
--- a/elisp/geiser-impl.el
+++ b/elisp/geiser-impl.el
@@ -31,7 +31,7 @@
:type '(repeat symbol)
:group 'geiser-implementation)
-(geiser-custom--defcustom geiser-implementations-alist '(((regexp "\\.ss$") plt))
+(geiser-custom--defcustom geiser-implementations-alist nil
"A map from regular expressions or directories to implementations.
When opening a new file, its full path will be matched against
each one of the regular expressions or directories in this map in order to
@@ -143,9 +143,11 @@ determine its scheme flavour."
(switcher (intern (format "switch-to-%s" name)))
(runner-doc (format "Start a new %s REPL." name))
(switcher-doc (format "Switch to a running %s REPL, or start one." name))
+ (impl-rx (format "\\.\\(%s\\)\\.s\\(l?s|cm\\)$" name))
(ask (make-symbol "ask")))
`(progn
(geiser-impl--define ,load-file-name ',name ',parent ',methods)
+ (geiser-impl--add-to-alist 'regexp ,impl-rx ',name t)
(require 'geiser-repl)
(defun ,runner ()
,runner-doc
@@ -157,8 +159,8 @@ determine its scheme flavour."
(switch-to-geiser ,ask ',name))
(provide ',(geiser-impl--feature name))))))
-(defun geiser-impl--add-to-alist (kind what impl)
- (add-to-list 'geiser-implementations-alist (list (list kind what) impl)))
+(defun geiser-impl--add-to-alist (kind what impl &optional append)
+ (add-to-list 'geiser-implementations-alist (list (list kind what) impl) append))
;;; Trying to guess the scheme implementation:
diff --git a/elisp/geiser-plt.el b/elisp/geiser-plt.el
index 00e3590..893b97a 100644
--- a/elisp/geiser-plt.el
+++ b/elisp/geiser-plt.el
@@ -175,6 +175,9 @@ This function uses `geiser-plt-init-file' if it exists."
(display-help geiser-plt-external-help)
(check-buffer geiser-plt-guess))
+(geiser-impl--add-to-alist 'regexp "\\.mzscheme\\.sl?s$" 'plt t)
+(geiser-impl--add-to-alist 'regexp "\\.ss$" 'plt t)
+
(provide 'geiser-plt)
;;; geiser-plt.el ends here