summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-08-12 16:01:37 +0100
committerjao <jao@gnu.org>2022-08-12 16:01:37 +0100
commit956ec5ff543e9a0fcb3b3ceb339bb1e21c39719e (patch)
treefa90d874c6606be7cec9293fd295a709aa1c888f
parentbd3d4ab6d7dffd9f8565af32471dc58aaf5a2214 (diff)
downloadgeiser-956ec5ff543e9a0fcb3b3ceb339bb1e21c39719e.tar.gz
geiser-956ec5ff543e9a0fcb3b3ceb339bb1e21c39719e.tar.bz2
geiser-repl: new variables startup-hook and startup-forms
See discussion in issue #48.
-rw-r--r--elisp/geiser-repl.el20
-rw-r--r--news.org6
2 files changed, 25 insertions, 1 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 3ce191f..897a17b 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -1,4 +1,4 @@
-;;; geiser-repl.el --- Geiser's REPL
+;;; geiser-repl.el --- Geiser's REPL -*- lexical-binding: t; -*-
;; Copyright (C) 2009-2013, 2015-2016, 2018-2022 Jose Antonio Ortega Ruiz
@@ -206,6 +206,20 @@ This variable is a good candidate for .dir-locals.el.
This option has no effect if no project root is found."
:type '(choice boolean (list string)))
+(geiser-custom--defcustom geiser-repl-startup-hook nil
+ "Functions run right after a REPL has started and is fully set up.
+
+See also `geiser-repl-startup-forms'."
+ :type 'hook)
+
+(geiser-custom--defcustom geiser-repl-startup-forms nil
+ "List scheme forms, as strings, sent to a REPL on start-up.
+
+This variable is a good candidate for .dir-locals.el.
+
+See also `geiser-repl-startup-hook'."
+ :type '(repeat string))
+
(geiser-custom--defface repl-input
'comint-highlight-input geiser-repl "evaluated input highlighting")
@@ -563,6 +577,10 @@ will be set up using `geiser-connect-local' when a REPL is started.")
t)
(set-process-query-on-exit-flag (get-buffer-process (current-buffer))
geiser-repl-query-on-kill-p)
+ (dolist (f geiser-repl-startup-forms)
+ (geiser-log--info "Evaluating startup form %s..." f)
+ (geiser-eval--send/wait `(:eval (:scm ,f))))
+ (run-hooks geiser-repl-startup-hook)
(message "%s up and running!" (geiser-repl--repl-name impl))))
(defvar-local geiser-repl--connection-buffer nil)
diff --git a/news.org b/news.org
index 9343de5..74ca564 100644
--- a/news.org
+++ b/news.org
@@ -1,3 +1,9 @@
+* Version 0.25 (unreleased)
+
+ - Fix: support for .dir-locals.el in REPL buffers
+ - New customizable variables: geiser-repl-startup-hook and
+ geiser-repl-startup-forms.
+
* Version 0.24 (May, 2022)
- Support for #{...}# extended symbol syntax