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

查看:177
本文介绍了在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-x shell中.如果您使用的是类似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 安装SLIME

Also, I'd advise to install SLIME through quicklisp-slime-helper

您将需要安装一些自己喜欢的Lisp(为此,将其设置为SBCL,如上所述),然后在同一外壳中执行以下操作:

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)

现在您又回到了常规外壳中.启动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")

或将"sbcl"替换为您安装的Lisp实现.

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天全站免登陆