emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/geiser ed6d6a1b36: Set REPL's default directory to project


From: ELPA Syncer
Subject: [nongnu] elpa/geiser ed6d6a1b36: Set REPL's default directory to project's root
Date: Wed, 23 Feb 2022 12:58:21 -0500 (EST)

branch: elpa/geiser
commit ed6d6a1b362fe389acb7f7e1bf6d89ff88e060af
Author: jao <jao@gnu.org>
Commit: jao <jao@gnu.org>

    Set REPL's default directory to project's root
---
 doc/repl.texi        | 5 +++++
 elisp/geiser-repl.el | 1 +
 news.org             | 4 ++++
 3 files changed, 10 insertions(+)

diff --git a/doc/repl.texi b/doc/repl.texi
index 4f28d823e5..6734d82c35 100644
--- a/doc/repl.texi
+++ b/doc/repl.texi
@@ -443,10 +443,15 @@ Guile), and, sometimes a global list of paths to add to 
the
 interpreter's load path (that'd be @code{geiser-guile-load-path} for
 Guile).
 
+@cindex default directory
 There is also a generic mechanism to specify how to add directories to
 the initial load path when @code{geiser-repl-current-project-function}
 is set: you can then customize @code{geiser-repl-add-project-paths} to a
 list of subdirectories of the project's root to add to the load path.
+When this option is set, the working directory of the REPL's buffer
+(i.e., the value of the elisp variable @code{default-directory}) will be
+set to the directory returned by
+@code{geiser-repl-current-project-function}).
 
 These variables controlling your scheme's initialisation process are
 good candidates for an entry in a project's @file{.dir-locals.el} file,
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 60ce214c92..57ae2041f7 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -520,6 +520,7 @@ will be set up using `geiser-connect-local' when a REPL is 
started.")
 (defun geiser-repl--set-up-load-path ()
   (when geiser-repl-add-project-paths
     (when-let (root (funcall geiser-repl-current-project-function))
+      (setq-local default-directory root)
       (dolist (p (cond ((eq t geiser-repl-add-project-paths) '("."))
                        ((listp geiser-repl-add-project-paths)
                         geiser-repl-add-project-paths)))
diff --git a/news.org b/news.org
index bc675f7980..638634ad53 100644
--- a/news.org
+++ b/news.org
@@ -1,4 +1,8 @@
 
+* Version 0.23 (unreleased)
+
+  - Set REPL's default directory to project's root
+
 * Version 0.22.2 (February, 2022)
 
   - Bug fixes (byte-compiler warnings, corfu compatibility).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]