emacs-guix (publ. 2024-11-06)
I finished uploading my two videos for EmacsConf 2024, and I don't like taking walks in the winter. So, I have some time now during my lunchbreaks to work on programming projects. I've become fanatical now about Emacs, so I wanted to do something in that direction. A need I noticed a month or so ago was that the emacs-guix package, which is an Emacs interface to the guix operating system, has experienced some bitrot, and nobody else seems to have any time to work on it. So I decided to focus on fixing bugs in emacs-guix.
My main work so far has been troubleshooting on bug #73462, and then submitting a work-around patch:
emacs-guix: shell commands broken
In the process, I've learned quite a few things. For starters, I learned how to use the debbugs interface for Emacs, which allows me to view bugs, apply patches, and submit bugs, all from Emacs Gnus buffers.
GNU ELPA - debbugs
I already use Gnus for all my other e-mail work, so this is natural enough.
Here are some functions I use for quickly viewing my bugs:
(defun my-emacs-bugs ()
(interactive)
(apply #'debbugs-gnu-bugs
(debbugs-get-bugs :package "emacs"
:submitter "me"
:status "open")))
(defun my-guix-bugs ()
(interactive)
(apply #'debbugs-gnu-bugs
(debbugs-get-bugs :package "guix"
:submitter "me"
:status "open")))
The use of the string "me" for submitter assumes that you have set the variable user-mail-address.
I learned some things, of course, about how emacs-guix works, as well as the Guile Scheme guix code that it calls. You can see the bug report above to find out more about that.
I also cloned emacs-guix locally, and I did the work to set up things so that I could run from that local copy and uninstall the normal guix package. emacs-guix includes instructions for that. One thing I had to figure out on my own was how to put the dependencies of emacs-guix in my home configuration, without having emacs-guix itself installed in the profile.
(home-environment
;; Below is the list of packages that will show up in your
;; Home profile, under ~/.guix-home/profile.
(packages (append
(map cadr (package-propagated-inputs emacs-guix))
emacs-packages
(specifications->packages
(list "abook"
"anki"
...etc...
So, what I am doing there is using package-propagated-inputs from (guix packages) to pull the dependencies of emacs-guix out of the emacs-guix package object, taken from (guix packages emacs-xyz). The propogated-inputs are the ones needed by emacs-guix to work during run time.
scheme@(guix-user)> (map cadr (package-propagated-inputs emacs-guix))
$7 = (#<package emacs-bui@1.2.1 gnu/packages/emacs-xyz.scm:6281 7fb4c3fba840> #<package emacs-dash@2.19.1 gnu/packages/emacs-xyz.scm:6253 7fb4c3fba8f0> #<package emacs-edit-indirect@0.1.13 gnu/packages/emacs-xyz.scm:15289 7fb4c400c6e0> #<package emacs-geiser@0.31.1 gnu/packages/emacs-xyz.scm:502 7fb4c3f8ad10> #<package emacs-geiser-guile@0.28.3 gnu/packages/emacs-xyz.scm:619 7fb4c3f8ab00> #<package emacs-magit-popup@2.13.3 gnu/packages/emacs-xyz.scm:1876 7fb4c3f99e70> #<package guile-gcrypt@0.4.0 gnu/packages/gnupg.scm:539 7fb4c4f0b630>)
Technically, we need the regular inputs as well, but in this case those are simply...
scheme@(guix-user)> (map cadr (package-inputs emacs-guix))
$5 = (#<package guile@3.0.9 gnu/packages/guile.scm:351 7fb4c50f7160> #<package guix@1.4.0-26.5ab3c4c gnu/packages/package-management.scm:183 7fb4c7cb4160>)
And for sure guix and guile binaries are already going to be available in my environment
One thing I'm a little confused about is how the Guile REPL in Emacs knows where the emacs-guix scheme code is located in my local repo. I wonder if maybe it is using a cached version of that.
Finally, here is the emacs-guix screenshot you never asked for:
complementary emacs-guix screenshot
Copyright
This work © 2024 by Christopher Howard is licensed under Attribution-ShareAlike 4.0 International.
CC BY-SA 4.0 Deed