在Emacs中由M-x机械师运行scmutils时出错 [英] Error running scmutils by M-x mechanics in emacs

查看:140
本文介绍了在Emacs中由M-x机械师运行scmutils时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从tar球下安装了scmutils(对于 SICM ) /usr/local.

然后将其放入我的.emacs:

(defun mechanics ()
  (interactive)
  (run-scheme
    "/usr/local/scmutils/mit-scheme/bin/scheme --library /usr/local/scmutils/mit-scheme/lib"
  ))

主要是来自 http://redsymbol.net/articles的说明/using-gnu-emacs-with-scmutils/.

但是我得到一个错误:

/usr/local/scmutils/mit-scheme/bin/scheme: 1: /usr/local/scmutils/mit-scheme/bin/scheme: 
Syntax error: "(" unexpected

Process scheme exited abnormally with code 2

我还尝试运行/usr/local/bin/mechanics,这是一个最终运行的shell脚本:

$ /usr/local/scmutils/mit-scheme/bin$ /usr/local/scmutils/mit-scheme/bin/scheme --library /usr/local/scmutils/mit-scheme/lib --heap 12000 --band edwin-mechanics.com --edit

$ bash: /usr/local/scmutils/mit-scheme/bin/scheme: cannot execute binary file

我认为有些不兼容.这是文件mit-scheme-x86-64":

mit-scheme-x86-64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, BuildID[sha1]=0x88f52caf274bb8298a0f6b84fc34beb9d2094bc6, not stripped

$ uname -r 

3.11.0-26-generic

任何人都可以指导我现在如何调试它?我正在VMWare Fusion(Mac OS X)中运行Ubuntu.

解决方案

问题的直接答案可能是VMWare无法识别二进制文件.

关于如何从Emacs运行scmutils的更一般的问题,以下是Debian和macOS的步骤:

Debian:

首先请确保您拥有MIT计划.如果不是,请执行sudo apt install mit-scheme.然后,从官方scutils页面下载压缩包. .提取并sudo ./install.sh.另外,sudo cp mechanics.sh /usr/local/bin/mechanics,现在您可以通过执行mechanics(在终端中运行)或mechanics -edit(弹出Edwin)来从bash运行scmutils.如果还没有的话,还需要sudo apt install texlive.然后,通过执行mechanics -edit打开Edwin来确认show-expression是否有效(如果字体太小,请参见我对另一个问题的回答),然后依次按(show-expression '(sqrt (+ x y)))M-z,它将弹出一个带有Latex的窗口.

太好了,show-expression本机可以在Edwin上运行!要在emacs上运行它很容易.首先,打开emacs,评估(require 'xscheme)(这似乎改变了run-scheme命令的含义),然后执行(run-scheme "/usr/local/bin/mechanics"),您将在emac中看到scmutils REPL.此时,逃避(up 1 2 3)应该可以,尽管请注意,与Edwin不同,您需要C-x C-e才能评估'M-z在这里不起作用.最后,使用eval (show-expression '(sqrt (+ x y))),它将起作用.

macOS :

这些指令取自该线程中的注释;我一年前写了它们,不再使用macOS,因此现在无法确认它们,但是它们应该有效.

安装Xquartz和"emacs for macOS"以及BasicTex.然后使用brew,安装mit-scheme和gv.最后,像上面的Debian部分一样,从压缩包中安装scmutils.确认show-expression在Edwin中可用,然后在emacs中,从Debian部分重复上述步骤,并确保使用setenv/Library/TeX/texbin添加到PATH.然后,show-expression应该可以在emacs上运行.

(同样,我现在还没有一台Macbook可以确认,但是大约一年前,当我使用与上述内容类似甚至不同的指示在本页中写下其他评论时,它开始起作用.) >

I have installed scmutils (for the book SICM) from the tar ball under /usr/local.

I then put this in my .emacs:

(defun mechanics ()
  (interactive)
  (run-scheme
    "/usr/local/scmutils/mit-scheme/bin/scheme --library /usr/local/scmutils/mit-scheme/lib"
  ))

which is mostly instruction from http://redsymbol.net/articles/using-gnu-emacs-with-scmutils/.

But I get an error:

/usr/local/scmutils/mit-scheme/bin/scheme: 1: /usr/local/scmutils/mit-scheme/bin/scheme: 
Syntax error: "(" unexpected

Process scheme exited abnormally with code 2

I also tried running /usr/local/bin/mechanics, which is a shell script that run eventually run:

$ /usr/local/scmutils/mit-scheme/bin$ /usr/local/scmutils/mit-scheme/bin/scheme --library /usr/local/scmutils/mit-scheme/lib --heap 12000 --band edwin-mechanics.com --edit

$ bash: /usr/local/scmutils/mit-scheme/bin/scheme: cannot execute binary file

I think there's some incompatibility. Here is the "file mit-scheme-x86-64":

mit-scheme-x86-64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, BuildID[sha1]=0x88f52caf274bb8298a0f6b84fc34beb9d2094bc6, not stripped

and

$ uname -r 

3.11.0-26-generic

Anyone can guide me how to debug this now? I am running Ubuntu in VMWare Fusion (Mac OS X).

解决方案

The direct answer to the body of the question is probably that VMWare can't recognize the binary.

For the more general problem of how to run scmutils from Emacs, here are the steps for Debian and macOS:

Debian:

First make sure you have MIT-scheme. If not, do sudo apt install mit-scheme. Then, download the tarball from the official scmutils page. Extract it and sudo ./install.sh. Also, sudo cp mechanics.sh /usr/local/bin/mechanics, and now you can run scmutils from bash by doing either mechanics (to run in terminal) or mechanics -edit (to pop up an Edwin). You also need to sudo apt install texlive if you haven't already. Then, confirm that show-expression works by doing mechanics -edit to open Edwin (if the font is too small, see my answer to another question), then (show-expression '(sqrt (+ x y))) and then M-z and it will pop up a window with the Latex.

Great, show-expression works natively on Edwin! To get it working on emacs is easy. First, open up emacs, evaluate (require 'xscheme) (This seems to change the meaning of the run-scheme command), then do (run-scheme "/usr/local/bin/mechanics"), and you will see a scmutils REPL in your emac. At this point, evaling (up 1 2 3) should work, though note that unlike Edwin, you need C-x C-e to eval' M-z won't work here. Finally, eval (show-expression '(sqrt (+ x y))), and it will work.

macOS:

These instructions taken from the comments in this thread; I wrote them a year ago and no longer use macOS, so cannot confirm them now, but they should work.

Install Xquartz and "emacs for macOS" and also BasicTex. Then using brew, install mit-scheme and gv. Finally, install scmutils from the tarball like in the Debian part above. Confirm that show-expression works in Edwin, then in emacs, repeat the steps above from the Debian section, and also make sure to use setenv to add /Library/TeX/texbin to PATH. Then, show-expression should work from emacs.

(again, I don't have a macbook to confirm now, but I got it working about a year ago when I wrote the other comments in this page, using similar, if not identical instructions to the above).

这篇关于在Emacs中由M-x机械师运行scmutils时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆