summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-12-05 01:15:43 +0000
committerjao <jao@gnu.org>2021-12-05 01:15:43 +0000
commit1e6ede956964a019559b5bb981afe8b828c51837 (patch)
tree4127e49594e98249b13ff7b856e7caac990f4eae /elisp
parent8985e7995e87b2ac95306e3c5e962b8c7b50d83a (diff)
downloadgeiser-1e6ede956964a019559b5bb981afe8b828c51837.tar.gz
geiser-1e6ede956964a019559b5bb981afe8b828c51837.tar.bz2
New option geiser-repl-add-project-path-p
Together with project-current as a default for the project root function when available, now that Emacs 28 is on the horizon.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-repl.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index c2a490e..e74a187 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -180,6 +180,12 @@ images popping up in the REPL.
See also `geiser-debug-auto-display-images-p'."
:type 'boolean)
+(geiser-custom--defcustom geiser-repl-add-project-path-p t
+ "Whether to automatically add current project's root to load path on startup.
+For this option to take effect,
+`geiser-repl-current-project-function' must be set appropriately."
+ :type 'boolean)
+
(geiser-custom--defface repl-input
'comint-highlight-input geiser-repl "evaluated input highlighting")
@@ -511,6 +517,9 @@ module command as a string")
(geiser-repl--startup impl address)
(geiser-repl--autodoc-mode 1)
(geiser-company--setup geiser-repl-company-p)
+ (when geiser-repl-add-project-path-p
+ (when-let (root (funcall geiser-repl-current-project-function))
+ (geiser-add-to-load-path (cdr root))))
(add-hook 'comint-output-filter-functions
'geiser-repl--output-filter
nil