diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-09-11 22:47:08 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-09-11 22:47:08 +0200 |
commit | 5a2b4648fc9c4212fe19e8794fc2b15230710b95 (patch) | |
tree | 71070415bf9aeb6f85bc44e370f16af2448439ad /elisp/geiser-racket.el | |
parent | 5a3362429fc4b3daee7cab0718f2c1cadc467ab3 (diff) | |
download | geiser-guile-5a2b4648fc9c4212fe19e8794fc2b15230710b95.tar.gz geiser-guile-5a2b4648fc9c4212fe19e8794fc2b15230710b95.tar.bz2 |
Racket: support for gracket-text
Diffstat (limited to 'elisp/geiser-racket.el')
-rw-r--r-- | elisp/geiser-racket.el | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el index fc3fe23..3d164f1 100644 --- a/elisp/geiser-racket.el +++ b/elisp/geiser-racket.el @@ -27,12 +27,20 @@ (geiser-custom--defcustom geiser-racket-binary (cond ((eq system-type 'windows-nt) "Racket.exe") - ((eq system-type 'darwin) "racket") (t "racket")) "Name to use to call the racket executable when starting a REPL." :type '(choice string (repeat string)) :group 'geiser-racket) +(geiser-custom--defcustom geiser-racket-gracket-binary + (cond ((eq system-type 'windows-nt) "GRacket-text.exe") + (t "gracket-text")) + "Name to use to call the gracket executable when starting a REPL. +This executable is used by `run-gracket', and, if +`geiser-racket-use-gracket-p' is set to t, by `run-racket'." + :type '(choice string (repeat string)) + :group 'geiser-racket) + (geiser-custom--defcustom geiser-racket-collects nil "A list of paths to be added to racket's collection directories." :type '(repeat file) @@ -43,24 +51,34 @@ :type 'string :group 'geiser-racket) +(geiser-custom--defcustom geiser-racket-use-gracket-p nil + "Whether to use the gracket binary to start Racket REPLs." + :type 'boolean + :group 'geiser-racket) + ;;; REPL support: -(defun geiser-racket--binary () - (if (listp geiser-racket-binary) - (car geiser-racket-binary) +(defsubst geiser-racket--real-binary () + (if geiser-racket-use-gracket-p + geiser-racket-gracket-binary geiser-racket-binary)) +(defun geiser-racket--binary () + (let ((binary (geiser-racket--real-binary))) + (if (listp binary) (car binary) binary))) + (defun geiser-racket--parameters () "Return a list with all parameters needed to start racket. This function uses `geiser-racket-init-file' if it exists." (let ((init-file (and (stringp geiser-racket-init-file) - (expand-file-name geiser-racket-init-file)))) + (expand-file-name geiser-racket-init-file))) + (binary (geiser-racket--real-binary))) `("-i" "-q" "-S" ,(expand-file-name "racket/" geiser-scheme-dir) ,@(apply 'append (mapcar (lambda (p) (list "-S" p)) geiser-racket-collects)) - ,@(and (listp geiser-racket-binary) (cdr geiser-racket-binary)) + ,@(and (listp binary) (cdr binary)) ,@(and init-file (file-readable-p init-file) (list "-f" init-file)) "-f" ,(expand-file-name "racket/geiser.rkt" geiser-scheme-dir)))) @@ -219,6 +237,12 @@ This function uses `geiser-racket-init-file' if it exists." (geiser-impl--add-to-alist 'regexp "\\.ss$" 'racket t) (geiser-impl--add-to-alist 'regexp "\\.rkt$" 'racket t) +(defun run-gracket () + "Start the Racket REPL using gracket instead of plain racket." + (interactive) + (let ((geiser-racket-use-gracket-p t)) + (run-racket))) + (provide 'geiser-racket) ;;; geiser-racket.el ends here |