unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Mekeor Melire <mekeor@posteo.de>
To: help-guix <help-guix@gnu.org>
Subject: Emacs and Geiser: Completion for Guix specific code?
Date: Wed, 16 Nov 2022 11:07:13 +0000	[thread overview]
Message-ID: <87wn7vjg8o.fsf@posteo.de> (raw)

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

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



[-- Attachment #2: mre.el --]
[-- Type: text/plain, Size: 327 bytes --]

(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"))

[-- Attachment #3: mre.scm --]
[-- Type: text/plain, Size: 55 bytes --]

(use-modules
 (gnu)
 (gnu system)
 (guix utils))

(ope

             reply	other threads:[~2022-11-16 11:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 11:07 Mekeor Melire [this message]
2022-11-16 11:49 ` Emacs and Geiser: Completion for Guix specific code? Mekeor Melire
2022-11-16 14:51 ` Luis Felipe
2022-11-16 16:41   ` Mekeor Melire
2022-11-16 23:27     ` Luis Felipe

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=87wn7vjg8o.fsf@posteo.de \
    --to=mekeor@posteo.de \
    --cc=help-guix@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.
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).