在 emacs 中设置 SLIME [英] Setting SLIME in emacs

查看:21
本文介绍了在 emacs 中设置 SLIME的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装 Slime.我下载了压缩包,根据README文件,我必须把这段代码放在我的Emacs配置文件中:

I was trying to install SLIME. I downloaded the zipped package and according to the README file, I have to put this piece of code in my Emacs configuration file:

(add-to-list 'load-path "~/hacking/lisp/slime/")  ; your SLIME directory
(setq inferior-lisp-program "/opt/sbcl/bin/sbcl") ; your Lisp system
(require 'slime)
(slime-setup)

设置 SLIME 目录很简单,但是 Lisp系统"呢?我如何找到它?

Setting the SLIME directory is straightforward, but what about the Lisp "system"? How do I find it?

推荐答案

有些 Linux 预装了 CMUCL,但由于您似乎想使用 SBCL,因此您需要安装它.

Some Linuxes come with CMUCL preinstalled, but since you seem to want to use SBCL, you would need to install it.

在终端或 Emacs M-xshell 中.如果您使用的是类似 Debian 的发行版,您可以使用 apt-get 或 aptitude 进行以下操作:

In terminal, or in Emacs M-xshell. If you are using Debian-like distro, you can use apt-get or aptitude with the following:

$ sudo apt-get install sbcl

$ sudo aptitude install sbcl

在类似 RHEL 的发行版上:

on RHEL-like distro:

$ sudo yum install sbcl

安装SBCL后,您可以将inferior-lisp-program设置为sbcl".

After SBCL is installed, you can set inferior-lisp-program to "sbcl".

另外,我建议通过 quicklisp-slime-helper

您需要安装一些您喜欢的 Lisp(为此目的让它成为 SBCL,如上所述),然后,在同一个 shell 中执行以下操作:

You would need to install some Lisp you like (let it be SBCL for this purpose, as described above), then, in the same shell do this:

(假设您使用的是类似 Debian 的 Linux)

(Suppose you are on a Debian-like Linux)

$ sudo apt-get install wget
$ cd ~/Downloads
$ wget http://beta.quicklisp.org/quicklisp.lisp
$ sbcl --load ./quicklisp.lisp

等到你看到 Lisp shell 提示符,

wait until you see Lisp shell prompt,

* (quicklisp-quickstart:install)
* (ql:add-to-init-file)
* (ql:quickload "quicklisp-slime-helper")
* (quit)

现在您又回到了常规 shell 中.如果尚未打开,请启动 Emacs.C-f x~/.emacs.将下面的行添加到其中(而不是您在上面发布的内容):

now you are back in the regular shell. Launch Emacs, if not open yet. C-f x~/.emacs. Add the lines below to it (instead of what you posted above):

(load (expand-file-name "~/quicklisp/slime-helper.el"))
(setq inferior-lisp-program "sbcl")

或者用您安装的 Lisp 实现替换sbcl".

Or replace "sbcl" with the Lisp implementation you installed.

查看 Quicklisp 文档以了解更多信息.您会发现无论如何以后都会使用 Quicklisp,因此从一开始就将所有内容集中在一个地方会很有用.

Look into Quicklisp documentation for more information. You will find that you will be using Quicklisp later anyway, so it's useful you get it all in one place from the start.

这篇关于在 emacs 中设置 SLIME的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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