summaryrefslogtreecommitdiff
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
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.
-rw-r--r--doc/parens.texi7
-rw-r--r--doc/repl.texi13
-rw-r--r--elisp/geiser-repl.el9
-rw-r--r--news.org5
4 files changed, 28 insertions, 6 deletions
diff --git a/doc/parens.texi b/doc/parens.texi
index ee4f0a8..89b73ce 100644
--- a/doc/parens.texi
+++ b/doc/parens.texi
@@ -222,9 +222,16 @@ project-management library of choice (eg. @code{project.el} or
associate themselves with the current project, and all Geiser commands
will ignore REPLs that are not associated with the project.
+@cindex geiser-repl-add-project-path-p
This can be very convenient when used with a @file{.dir-locals.el} in
the project root to set include paths, ensuring that Geiser REPLs will
always know where to find your project's modules or dependencies.
+Geiser automatically handles the common case of the project root
+belonging to the load path: unless you tell it otherwise (using the
+customisable flag @code{geiser-repl-add-project-path-p}, which defaults
+to @code{t}), will add the result of calling
+@code{geiser-repl-current-project-function} to the REPLs load path on
+startup.
@subsubheading Switching between source files and the REPL
@cindex switching to REPL
diff --git a/doc/repl.texi b/doc/repl.texi
index 9cb4ae4..2209ad0 100644
--- a/doc/repl.texi
+++ b/doc/repl.texi
@@ -453,15 +453,16 @@ good candidates for an entry in a project's @file{.dir-locals.el} file,
so that they are automatically set to a sensible value whenever you
start a REPL in the project's directory.
-@subsubheading Racket startup time
+@subsubheading Startup waiting time
@cindex startup timeout
@cindex timeout
-When starting Racket in little computers, Geiser might have to wait a
-bit more than it expects (which is ten seconds, or ten thousand
-milliseconds, by default). If you find that Geiser is giving up too
-quickly and complaining that no prompt was found, try to increase the
-value of @code{geiser-repl-startup-time} to, say, twenty seconds:
+When starting a scheme implementation in old or very busy computers,
+Geiser might have to wait a bit more than it expects (which is ten
+seconds, or ten thousand milliseconds, by default). If you find that
+Geiser is giving up too quickly and complaining that no prompt was
+found, try to increase the value of @code{geiser-repl-startup-time} to,
+say, twenty seconds:
@example
(setq geiser-repl-startup-time 20000)
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
diff --git a/news.org b/news.org
index 3c7890b..959e411 100644
--- a/news.org
+++ b/news.org
@@ -1,3 +1,8 @@
+* Version 0.20 (unreleased)
+ - New option to add current project's root to load path,
+ ~geiser-repl-add-project-path-p~.
+ - Defaulting ~geiser-repl-current-project-function~ to ~project-current~
+ in emacsen having it available.
* Version 0.19 (December, 2021)
- Bug fixes
* Version 0.18 (October, 2021)