summaryrefslogtreecommitdiff
path: root/elisp
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
commita9c8026ca23ae980e0288b4657567fc586673e3c (patch)
tree7ac4d8fe2fa8fbf6ef8d15baee64ca1b655f5e5e /elisp
parentf4bfd4dbd6e91b60a80be309ffa70b7aeb7870a9 (diff)
downloadgeiser-chez-a9c8026ca23ae980e0288b4657567fc586673e3c.tar.gz
geiser-chez-a9c8026ca23ae980e0288b4657567fc586673e3c.tar.bz2
Letting implementations define their own file pattern matching rules.
Diffstat (limited to 'elisp')
-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