0

我是 Emacs 的新手,遇到了一些麻烦。我希望racket使用 Geiser 从 Emacs 运行。我告诉 Emacs 其中racket如下:

(setq geiser-racket-binary "/Applications/Racket\ v6.0/DrRacket.app")

(我从 StackOverflow 问题中得到这个:设置 Racket Geiser Emacs 路径。)

我首先编译保存的球拍代码。但是,当我尝试点击M-x后跟时run-geiser,它会提示我执行方案。此时我键入racket. Emacs 现在打开一个球拍 REPL 缓冲区,并在该缓冲区中留下错误:

无法执行程序: /Applications/Racketv6.0/DrRacket.app 。

如果有帮助,这是我的.emacs文件:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.

 '(geiser-repl-startup-time 20000)
 '(package-archives (quote (("gnu" . "elpa gnu packages website") ("melpa" . "http://melpa.milkbox.net/#/"))))    
 '(package-directory-list (quote ("/Applications/Emacs.app/Contents/Resources/site-lisp/elpa")))    
 '(python-python-command "/usr/local/bin/python3"))

(setq geiser-racket-binary "/Applications/Racket\ v6.0/DrRacket.app")    
(setq-default cursor-type 'bar)

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:inherit nil :stipple nil :background "controlDarkShadowColor" :foreground "Green" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "apple" :family "Monaco")))))

(require 'package)

(add-to-list 'package-archives 
     '("marmalade" .
      "http://marmalade-repo.org/packages/"))
(package-initialize)
4

2 回答 2

1

我认为您引用了错误的可执行文件。

“DrRacket”是一个用于编辑 Racket 代码的 IDE(带有图形用户界面)。来自man drracket

DrRacket 是 Racket 编程环境。

尝试设置geiser-racket-binaryracket可执行文件的位置(这是“核心 Racket 实现”)。


编辑

如果 Mac 安装 Racket 的命名方案类似于用于 Linux 安装的命名方案,则应该有一个名为Racketor的二进制文件racket,其位置类似于您可以找到DrRacket(或drracket)二进制文件的位置:

$ locate racket
...
/usr/bin/drracket
/usr/bin/gracket
/usr/bin/gracket-text
/usr/bin/racket
...

(并不是说会在 中找到二进制文件/usr/bin/,只是试图说明所有可能相关的二进制文件很有可能位于同一目录中。)

于 2014-04-23T08:36:08.877 回答
0

在 OS Xxxx.app上,技术上是一个目录。实际的可执行文件位于Content/MacOS/xxx(如果我没记错的话)。

编辑:换句话说,您应该编写如下内容:

(setq geiser-racket-binary "/Applications/Racket\ v6.0/DrRacket.app/Content/MacOS/DrRacket")

注意:我不在我的 Mac 上,所以我现在无法验证详细信息。

于 2014-04-23T07:35:32.617 回答