简体   繁体   English

在“ emacs”(最新版本)中设置“ Slime”时,如何告诉我更快地加载swank?

[英]when setting up “Slime” in “emacs”(latest version) how do i tell it to load swank faster?

the slime manual says this: "Loading Swank faster For SBCL, we recommend that you create a custom core file with socket support and POSIX bindings included because those modules take the most time to load. To create such a core, execute the following steps: 粘液手册说:“更快地加载Swank对于SBCL,我们建议您创建一个包含套接字支持和POSIX绑定的自定义核心文件,因为这些模块花费了最多的时间。要创建这样的核心,请执行以下步骤:

shell$ sbcl
*(mapc ’require ’(sb-bsd-sockets sb-posix sb-introspect sb-cltl2 asdf))
 *(save-lisp-and-die "sbcl.core-for-slime")

After that, add something like this to your '.emacs': 之后,在您的'.emacs'中添加以下内容:

(setq slime-lisp-implementations
’((sbcl ("sbcl" "--core" "sbcl.core-for-slime"))))"

I know how to add stuff to my .emacs file but what exactly do i do for the part below i\\e where, exactly, and how do i execute the steps below....i\\e where do i type it. 我知道如何向.emacs文件中添加内容,但是对于下面的部分,我到底该怎么做?确切地说,以及如何执行以下步骤....我在哪里键入它。 "execute the following steps: “执行以下步骤:

shell$ sbcl
* (mapc ’require ’(sb-bsd-sockets sb-posix sb-introspect sb-cltl2 asdf))
* (save-lisp-and-die "sbcl.core-for-slime")"

please be specific ...I'm a noob 请具体...我是菜鸟

I know how to add stuff to my .emacs file but what exactly do i do for the part below i\\e where, exactly, and how do i execute the steps below....i\\e where do i type it. 我知道如何向.emacs文件中添加内容,但是对于下面的部分,我到底该怎么做?确切地说,以及如何执行以下步骤....我在哪里键入它。 "execute the following steps: “执行以下步骤:

You start up your Lisp implementation in a shell, and enter in its REPL. 您可以在Shell中启动Lisp实现,然后输入其REPL。 While Slime is a Common Lisp (and a few languages more) environment for Emacs, the actual CL implementation is not included or part of Emacs. 尽管Slime是Emacs的Common Lisp(以及更多种语言)环境,但实际的CL实现不包括在Emacs中,也不是Emacs的一部分。 (Emacs itself uses a somewhat similar but different dialect, Emacs Lisp.) (Emacs本身使用了某种相似但不同的方言Emacs Lisp。)

So, you have to install SBCL separately, start it, and then enter the commands above in its REPL. 因此,您必须单独安装SBCL,启动它,然后在其REPL中输入上述命令。

(mapc #'require '(sb-bsd-sockets sb-posix sb-introspect sb-cltl2 asdf))

Note that you have to use ' , not ' for it to work. 请注意,您必须使用' ,而不是'才能正常工作。 This will load the systems in your Lisp image, and: 这会将系统加载到您的Lisp映像中,并且:

(save-lisp-and-die "sbcl.core-for-slime")

will save that image into the file sbcl.core-for-slime . 会将图像保存到文件sbcl.core-for-slime When you tell SBCL to use that image (also called core image), you won't have to load the above systems again, because they are already part of the loaded image. 当您告诉SBCL使用该映像(也称为核心映像)时,您不必再次加载上述系统,因为它们已经是已加载映像的一部分。 That's what the 那就是

(setq slime-lisp-implementations
      '((sbcl ("sbcl" "--core" "sbcl.core-for-slime"))))

in your .emacs does – it tells SLIME to use the command sbcl --core sbcl.core-for-slime when starting SBCL. 您的.emacs执行的操作–告诉SLIME在启动SBCL时使用命令sbcl --core sbcl.core-for-slime

Also note, that Common Lisp is the name of the language, while CLISP is just an implementation, like SBCL. 还要注意, Common Lisp是语言的名称,而CLISP只是一种实现,例如SBCL。 I'll retag your question accordingly. 我将相应地重新标记您的问题。

Shell is a command-line interface to your computer. Shell是计算机的命令行界面。 In Emacs, you may get to a shell by entering Mx shell (ie., pressing these keys in sequence: Esc x s h e l l Enter ). 在Emacs中,您可以通过输入的Mx得到一个壳shell (即按顺序这些键:Esc键 X E的 L- l 进入 )。 A new window will come up, and in it a shell prompt waiting for your input. 将会出现一个新窗口,其中有一个shell提示符等待您的输入。 Enter sbcl at the prompt to start SBCL; 在提示符下输入sbcl以启动SBCL; you may then enter the lisp code snippets to create a new core. 然后,您可以输入Lisp代码段以创建新的核心。

For the above to work, you have to have SBCL installed first (eg, by following the instructions at www.sbcl.org ). 为了使上述方法起作用,您必须首先安装SBCL(例如,按照www.sbcl.org上的说明进行操作 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM