From 6b9b733315ec0d3fa0690ed004b09e6a63f35021 Mon Sep 17 00:00:00 2001
From: Luis Osa <luis.osa.gdc@gmail.com>
Date: Thu, 7 Feb 2019 22:47:44 +0100
Subject: 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.
---
 elisp/geiser-chez.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'elisp')

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 "> ")
-- 
cgit v1.2.3