Mathieu Lirzin (2015-11-22 21:20 +0300) wrote:

[...]
> guix-load-path is a variable defined in `guix-backend.el'.
> Its value is "~/src/gnu/guix/emacs"
>
>>
>> Also just in case, show the value of `guix-helper-file' variable.
>
>
> guix-helper-file is a variable defined in `guix-backend.el'.
> Its value is "/home/mthl/src/gnu/guix/emacs/guix-helper.scm"
>
> These two variables helped me figure out that the problem was the use of
> “~” in:
>
>   (let ((dir "~/src/gnu/guix/emacs"))
>     ...

Ouch, my bad, sorry.  Yes, IIUC Guile %load-path should contain absolute
directories, and as Geiser does not expand the contents of
`geiser-guile-load-path', this "~/..." string literally goes to
%load-path.

> When changing it with “/home/mthl” it works!  To avoid this kind of
> mistake in the future, a simple fix would be to change the example in
> the documentation, with:
>
>   (let ((dir "/absolute/path/to/your-guix-git-tree/emacs"))
>     ...
>
> But is there a way to change the implementation to let users use
> relative path?

Yes, the fix is easy.  The patch is attached, could you confirm that it
works?

Thank you for finding the root of this bug!

>From 9788f62b319392f261a73704135f36536b1560e0 Mon Sep 17 00:00:00 2001
From: Alex Kost <alez...@gmail.com>
Date: Sun, 22 Nov 2015 23:36:39 +0300
Subject: [PATCH] emacs: Expand 'guix-load-path'.

Reported by Mathieu Lirzin <m...@gnu.org> at
<http://lists.gnu.org/archive/html/guix-devel/2015-11/msg00585.html>.

* emacs/guix-backend.el (guix-start-repl): Expand 'guix-load-path' to
  avoid relative directory name in Guile %load-path.
---
 emacs/guix-backend.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/emacs/guix-backend.el b/emacs/guix-backend.el
index e7c158b..82383e4 100644
--- a/emacs/guix-backend.el
+++ b/emacs/guix-backend.el
@@ -202,7 +202,7 @@ this address (it should be defined by
   ;; A mix of the code from `geiser-repl--start-repl' and
   ;; `geiser-repl--to-repl-buffer'.
   (let ((impl 'guile)
-        (geiser-guile-load-path (cons guix-load-path
+        (geiser-guile-load-path (cons (expand-file-name guix-load-path)
                                       geiser-guile-load-path))
         (geiser-repl-startup-time guix-repl-startup-time))
     (with-current-buffer buffer
-- 
2.6.1

Reply via email to