summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Osa <luis.osa.gdc@gmail.com>2019-02-07 22:47:44 +0100
committerLuis Osa <luis.osa.gdc@gmail.com>2019-02-07 22:47:44 +0100
commit6b9b733315ec0d3fa0690ed004b09e6a63f35021 (patch)
treee3488fe3f22e5fac190c2f3888dcc23246978c35
parenta5a617648a445ff323bc7c832786769782d8c45c (diff)
downloadgeiser-chez-6b9b733315ec0d3fa0690ed004b09e6a63f35021.tar.gz
geiser-chez-6b9b733315ec0d3fa0690ed004b09e6a63f35021.tar.bz2
Add geiser-chez-init-file
Add a new customization variable for an init file to be read on startup of a Chez REPL, where user code can be defined. The usage is copied from the equivalent Racket init file, to avoid an error if the file has not been created.
-rw-r--r--elisp/geiser-chez.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/elisp/geiser-chez.el b/elisp/geiser-chez.el
index ff75e5a..c6f7130 100644
--- a/elisp/geiser-chez.el
+++ b/elisp/geiser-chez.el
@@ -32,6 +32,11 @@
:type '(choice string (repeat string))
:group 'geiser-chez)
+(geiser-custom--defcustom geiser-chez-init-file "~/.chez-geiser"
+ "Initialization file with user code for the Chez REPL."
+ :type 'string
+ :group 'geiser-chez)
+
;;; REPL support:
@@ -43,7 +48,10 @@
(defun geiser-chez--parameters ()
"Return a list with all parameters needed to start Chez Scheme.
This function uses `geiser-chez-init-file' if it exists."
- `(,(expand-file-name "chez/geiser/geiser.ss" geiser-scheme-dir))
+ (let ((init-file) (and (stringp geiser-chez-init-file)
+ (expand-file-name geiser-chez-init-file)))
+ `(,@(and init-file (file-readable-p init-file) (list init-file))
+ ,(expand-file-name "chez/geiser/geiser.ss" geiser-scheme-dir)))
)
(defconst geiser-chez--prompt-regexp "> ")