On Mon, Sep 26, 2022 at 10:44 PM Maxim Cournoyer <maxim.courno...@gmail.com> wrote: > > Hi, > > Olivier Dion via "Development of GNU Guix and the GNU System > distribution." <guix-devel@gnu.org> writes: > > [...] > > > I have the following in my .dir-locals.el for my library libpatch. The > > idea is the same, but without direnv: > > > > ((nil > > . ((eval . > > (let ((root (locate-dominating-file > > default-directory ".dir-locals.el"))) > > (when root > > (let ((real-root (directory-file-name (expand-file-name root)))) > > (setq-local geiser-guile-binary (concat real-root > > "/.geiser-guile")) > > (setq-local projectile-project-compilation-cmd > > (concat real-root "/.projectile-compile")) > > (setq-local projectile-project-test-cmd > > (concat real-root "/.projectile-test"))))))))) > > > > It seems to me it'd help everyone if Geiser should handle the above by > itself. It'd be cool to have the above functionality merged into Geiser > itelf. Just saying; thank you for sharing!
With Emacs 28 and new versions of Geiser (such as the one in Guix) I highly recommend enabling per-project REPLs. By setting geiser-repl-per-project-p to 't', commands like M-x run-guile and C-c C-a will open/switch to a REPL associated with the current project as determined by project.el. This is useful for when you are working on multiple projects at once as it makes it harder to mix up REPLs, but Geiser also automatically inserts the project root directory into Guile's load path. When combined with emacs-direnv, emacs-envrc, emacs-buffer-env, or emacs-guix-shell, the Guile binary that Geiser uses when launching a per-project REPL will be the one from the 'guix shell' profile, and it will honor the GUILE_LOAD_PATH/GUILE_LOAD_COMPILED_PATH settings. So now, at long last, my Geiser REPLs automatically use the proper build of Guile, it can load the external libraries my project depends on, *and* it can load my local project modules. I'm quite happy with this setup. Maybe I could write a blog post specifically about setting up a Guile development environment with Guix and include all these details. - Dave