将 chezschme 运行 设置为 geiser-default-implementation

Set chezschme run as geiser-default-implementation

我安装了 chezscheme

$ chezscheme
Chez Scheme Version 9.5
Copyright 1984-2017 Cisco Systems, Inc.

> (define a (list 4 5 6 ))
> (set-car! a 9)
> a
(9 5 6)

并将其配置为 geiser-default-implementation

(require 'geiser)
(setq geiser-active-implementations '(chez guile racket chicken mit chibi gambit))
(add-hook 'scheme-mode-hook 'geiser-mode)
(setq geiser-default-implementation 'chez)

尽管如此,当使用 org src 发出 C-c C-c 时

#+begin_src scheme :session sicp :lexical t
(define a (list 2 3 4))
(set-car! a 9)
a
#+end_src

#+RESULTS:

缓冲了很久提示在minibuffer中'chez go and up'

但 运行 MIT 方案。

错误:

MIT/GNU Scheme running under GNU/Linux
Type `^C' (control-C) followed by `H' to obtain information about interrupts.

Copyright (C) 2019 Massachusetts Institute of Technology
This is free software; see the source for copying conditions. There is NO warranty; not even for
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Image saved on Thursday September 5, 2019 at 11:51:46 AM
  Release 10.1.10 || Microcode 15.3 || Runtime 15.7 || SF 4.41 || LIAR/x86-64 4.118
;Warning: Invalid keyword: "/home/me/.emacs.d/.local/straight/build/geiser/scheme/chez/geiser/geiser.ss"
;Warning: Unhandled command line options: ("/home/me/.emacs.d/.local/straight/build/geiser/scheme/chez/geiser/geiser.ss")

附加:

添加geiser-chez-binary

(setq geiser-active-implementations '(chez guile))
(setq geiser-chez-binary "chez")
(add-hook 'scheme-mode-hook 'geiser-mode)
(setq geiser-default-implementation 'chez)

和运行

#+begin_src scheme   :session sicp :lexical t :results output
(define b (list 3 4))

#+end_src

它报告

    apply: Searching for program: No such file or directory, chez

然后我将 chez 附加到 org-babel-do-load-languages 并将关键字方案更改为 chez

#+begin_src chez   :session sicp :lexical t :results output
(define b (list 3 4))

#+end_src

它报告:

  No org-babel-execute function for chez!

删除了 mit-scheme 包并且它有效

默认情况下,Geiser 认为 Chez Scheme 的可执行文件是 scheme,但事实并非如此,Chez Scheme 使用 chez 而 Mit Scheme 使用 schememit-scheme。您需要将以下内容放入您的 Emacs 初始化文件中:

(setq geiser-chez-binary "chez")

这里是geiser-chez-binary的文档字符串(我已经把它改成了chez):

geiser-chez-binary is a variable defined in `geiser-chez.el'.
Its value is "chez"
Original value was "scheme"

Documentation:
Name to use to call the Chez Scheme executable when starting a REPL.

You can customize this variable.