私のEmacsの設定

私のEmacsの設定

Guixの公式ドキュメントでは、次のように説明します。完璧な設定Guix ハッキングに使用されます。私はこの説明に従い、説明したようにすべてを設定しましたが、Geiserはまだ完全には機能しません。私はこれが私に完成機能を提供し、物事の定義に行くことができると思います。私はいくつかの定義にアクセスできますが、ほんの一握りです。ほとんどのことは不可能です。完了は、現在のバッファのテキストのみに基づいているようです。

私のEmacsの設定

(use-package geiser
  :ensure t
  :custom
  (geiser-default-implementation 'guile)
  (geiser-active-implementations '(guile))
  (geiser-implementations-alist '(((regexp "\\.scm$") guile))))

(use-package geiser-guile
  :ensure t
  :config
  (add-to-list 'geiser-guile-load-path "/home/lars/code/forks/guix")
  (add-to-list 'geiser-guile-load-path "/home/lars/code/guix/modules")
  (add-to-list 'geiser-guile-load-path "/home/lars/code/guix"))

(with-eval-after-load "geiser-guile" 
  (add-to-list 'geiser-guile-load-path "/home/lars/code/forks/guix")
  (add-to-list 'geiser-guile-load-path "/home/lars/code/guix/modules")
  (add-to-list 'geiser-guile-load-path "/home/lars/code/guix"))

REPL

M-x geiser-guile私はEmacsでGeiser REPLを使用または呼び出しますM-x geiser

Geiser REPLの出力は次のとおりです。

GNU Guile 3.0.9
Copyright (C) 1995-2023 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> 

プロンプトにこう述べていますが、guile-user私の考えにはこう言わなければならないと思いますguix-user

guix replただし、端末で実行してGuix REPLを起動すると、出力は次のようになります。

GNU Guile 3.0.9
Copyright (C) 1995-2023 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)>

ここに記載されているので参考にしてくださいguix-user

guixGeiser REPLでモジュールを「使用」しようとするとき:

,use (guix)
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/lars/code/forks/guix/guix.scm
;;; compiling /home/lars/code/forks/guix/guix/packages.scm
;;; compiling /home/lars/code/forks/guix/guix/utils.scm
;;; WARNING: compilation of /home/lars/code/forks/guix/guix/utils.scm failed:
;;; no code for module (guix config)
;;; WARNING: compilation of /home/lars/code/forks/guix/guix/packages.scm failed:
;;; no code for module (guix config)
;;; compiling /home/lars/code/forks/guix/guix/store.scm
;;; WARNING: compilation of /home/lars/code/forks/guix/guix/store.scm failed:
;;; no code for module (guix config)
;;; WARNING: compilation of /home/lars/code/forks/guix/guix.scm failed:
;;; no code for module (guix config)
;;; compiling /home/lars/code/forks/guix/guix/derivations.scm
;;; compiling /home/lars/code/forks/guix/guix/diagnostics.scm
;;; WARNING: compilation of /home/lars/code/forks/guix/guix/diagnostics.scm failed:
;;; Unbound variable: trivial-format-string?
;;; WARNING: compilation of /home/lars/code/forks/guix/guix/derivations.scm failed:
;;; no code for module (gcrypt hash)
While executing meta-command:
no code for module (gcrypt hash)
scheme@(guile-user)>

Guix REPLで同じことを行うとうまくいきます。

scheme@(guix-user)> ,use (guix)
scheme@(guix-user)>

定義に移動

Gotoの定義は、次の行のようないくつかの場所で機能します。

(gnu home services)

これはGnuホームサービスのソースに直接接続されます。

ただし、パッケージ定義に移動しようとすると機能しません。

 (packages (list
            htop
            git
            alacritty
            tmux))

パッケージリストのパッケージ定義に移動しようとすると機能しません。

終わる

パッケージ名の先頭を入力してモジュールとパッケージを完成させたいのですが、何も表示されません。時には、同じバッファ内の任意のテキストに基づいてランダムな完了が発生しますが、ほとんどの場合はそうではありません。

ベストアンサー1

私は次の回避策でGeiserがほとんど動作するようにすることができました。

ラッパースクリプトを作成します。

#!/bin/bash
guix repl -L ~/code/guix -L ~/code/forks/guix "$@"

geiser-guile-binaryこのスクリプトを指すように変数を設定します。現在のバッファの Guile コード、特に(use-modules ...)必要な名前空間を抽出する部分を評価します。

また、Guixのソースコードのローカルレプリカが次のようにコンパイルされていることを確認する必要がありました。このガイドライン

これにより、インポートされたモジュールに含まれるすべての項目を完了でき、定義照会も変更されます。しかし、まだどのモジュールが利用可能かは完了していません。

おすすめ記事