From 1e6ede956964a019559b5bb981afe8b828c51837 Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 5 Dec 2021 01:15:43 +0000 Subject: 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. --- elisp/geiser-repl.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'elisp/geiser-repl.el') 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 -- cgit v1.2.3