Subject: bug#73462: [PATCH] emacs-guix: shell commands broken

From: Christopher Howard <[email-masked]>
Date: Wed, 06 Nov 2024 06:50:00 -0900

>From 282aea01d0212e3a9a2acac52d76a6a7325cf7e7 Mon Sep 17 00:00:00 2001
From: Christopher Howard <[email-masked]>
Date: Wed, 6 Nov 2024 05:53:45 -0900
Subject: [PATCH] Provides work-around for
 https://issues.guix.gnu.org/issue/73462

---
 elisp/guix-repl.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/elisp/guix-repl.el b/elisp/guix-repl.el
index bf1dc82..3d75ac6 100644
--- a/elisp/guix-repl.el
+++ b/elisp/guix-repl.el
@@ -1,6 +1,7 @@
 ;;; guix-repl.el --- Making and using Guix REPL
 
 ;; Copyright © 2014–2019 Alex Kost <[email-masked]>
+;; Copyright © 2024 Christopher Howard <[email-masked]>
 
 ;; This file is part of Emacs-Guix.
 
@@ -290,6 +291,10 @@ display messages."
                    (guix-get-repl-buffer-name internal))))
         (guix-start-repl repl (and internal guix-repl-current-socket))
         (set repl-var repl)
+        ;; work-around for https://issues.guix.gnu.org/issue/73462
+        (if internal
+            (guix-geiser-eval-in-repl-synchronously
+             ",re (guix gexp)" repl t t))
         ;; Wait until switching to (emacs-guix) module finishes.
         (guix-geiser-eval-in-repl-synchronously
          ",m (emacs-guix)" repl t t)
-- 
2.46.0

I've attached a patch for the emacs-guix source which works around this issue. It modifies the REPL starting process for the Internal REPL, so that the (guix gexp) module is explicitly (re)loaded, which allows to reader syntax to work when the other modules load. I do not know why this should be necessary.

I wondered if there is some subtle difference here when dealing with a REPL that is accessed over a socket, as is the case with the Internal REPL. But I can't reproduce the problem on the command-line, outside of emacs-guix, using sockets.

With this patch, the "guix shell command" popup opens, though I see there is something wrong with the popup itself. It does not ask for a command to run, and the popup options only attempt to run an empty command. But I could investigate that in a separate bug.

Troubleshooting/testing was done with GNU Emacs 30.0.92 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) of 2024-10-29.

-- 
Christopher Howard