unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: Mathieu Lirzin <mthl@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: How to use Guix.el from Git?
Date: Mon, 23 Nov 2015 00:05:09 +0300	[thread overview]
Message-ID: <8737vxpwxm.fsf@gmail.com> (raw)
In-Reply-To: <87egfh3ngg.fsf@gnu.org> (Mathieu Lirzin's message of "Sun, 22 Nov 2015 19:20:47 +0100")

[-- Attachment #1: Type: text/plain, Size: 1208 bytes --]

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!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-emacs-Expand-guix-load-path.patch --]
[-- Type: text/x-diff, Size: 1133 bytes --]

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

Reported by Mathieu Lirzin <mthl@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	other threads:[~2015-11-22 21:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-22 12:14 How to use Guix.el from Git? Mathieu Lirzin
2015-11-22 17:09 ` Alex Kost
2015-11-22 18:20   ` Mathieu Lirzin
2015-11-22 21:05     ` Alex Kost [this message]
2015-11-22 21:15       ` Mathieu Lirzin
2015-11-23  8:35         ` Alex Kost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737vxpwxm.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=mthl@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).