help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emacs and Geiser: Completion for Guix specific code?


From: Mekeor Melire
Subject: Emacs and Geiser: Completion for Guix specific code?
Date: Wed, 16 Nov 2022 11:07:13 +0000

Hello,

when editing a Guix system declaration (system.scm) with GNU Emacs and
Geiser (and corfu.el), can I get completion for Guix specific code?
Right now, I only get completion suggestions based on generic Guile
modules. E.g. completing "(ope" (by pressing C-M-i) does not offer
"(operating-system", but only "(open" etc. from module (guile). Is there
any way to get completion for the Guix-specific code?

You can reproduce the reported behaviour as follows.

1. Save the attached mre.el and mre.scm files somewhere.
2. Modify the path to the Guix repository inside mre.el.
3. Make sure you have these packages installed, e.g. with a guix-shell:

   guix shell emacs emacs-corfu emacs-corfu-doc emacs-geiser \
     emacs-geiser-guile guile

4. Open that directory in a shell, navigate to the saved files, and
   launch Emacs:

   emacs -Q -l mre.el

5. In Emacs, open mre.scm, start Geiser with M-x geiser RET, navigate
   the cursor to "(opeHERE", and press C-M-i (which runs
   completion-at-point). You'll see that it does not suggest
   "operating-system". (Even if you have compiled all Guix inside your
   local clone of its repository.)

Kindly
Mekeor


(require 'corfu)
(setq
  corfu-auto t
  corfu-auto-prefix 0
  corfu-quit-no-match t)
(global-corfu-mode)

;; optional:
(require 'corfu-doc)
(add-to-list 'corfu-mode-hook #'corfu-doc-mode)

(require 'geiser-guile)
(with-eval-after-load 'geiser-guile
  (add-to-list 'geiser-guile-load-path "/home/user/path/to/guix/repository"))
(use-modules
 (gnu)
 (gnu system)
 (guix utils))

(ope

reply via email to

[Prev in Thread] Current Thread [Next in Thread]