this post was submitted on 14 Dec 2024
11 points (100.0% liked)

Guix

339 readers
4 users here now

Guix is an advanced distribution of the GNU operating system developed by the GNU Project

founded 4 years ago
MODERATORS
 

I'm trying to configure my Emacs so that I get access to Guix documentation and source code when I writing my configuration files. I did RTFM, but I can't get it to work. More specifically, Geiser can only find symbol definitions if they are in the same buffer.

Actually, I realize I have the same problem as this person: https://unix.stackexchange.com/questions/761784/how-to-get-guix-perfect-setup-to-work

The Guix REPL can find the Guix source code, but the Geiser Guile REPL can't (even though the right path is loaded, it seems). The stackexchange solution is basically a hack and can't be the proper one, right? So, how do you do when developing Guix in Emacs?

Should I post a bug report about the "perfect setup" chapter in the Reference Manual or am I just incompetent?

top 1 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 1 month ago* (last edited 1 month ago)

Solved it! And it was mostly due to my incompetence (like not being good at RTFM and being a Guile Scheme noob). I did the following to get a functional Emacs environment for hacking on my Guix home configuration:

  1. Load the right path by adding the following to my init.el.
(with-eval-after-load 'geiser-guile
  (add-to-list 'geiser-guile-load-path "~/.config/guix/current/share"))
(with-eval-after-load 'geiser-guile
  (add-to-list 'geiser-guile-load-path "~/src/nonguix"))
  1. Load the configuration file with Geiser Guile. C-c C-l or geiser-load-file or geiser-load-current-buffer.

Then it should work.

I thought that it was enough to load the path to the cloned Guix (not compiled) source code and then just open a Geiser Guile REPL associated with the current file.

These two chapter in the manual helped: https://guix.gnu.org/manual/en/guix.html#Invoking-guix-repl and https://guix.gnu.org/manual/en/guix.html#Using-Guix-Interactively. I kind of missed these chapters and went straight for the "perfect setup".

I think the manual should inform new users that they can load ~/.config/guix/current/share/ into Geiser Guile if they want to hack on their home configuration. Or maybe I missed that part.