Common Lisp Programming in Emacs

开发环境配置

在Debianu下安装:

1. 安装sbcl及文档

sudo apt-get install sbcl*

2. 安装emacs

3. 安装slime

sudo apt-get install slime*

4. 配置slime

;(add-to-list 'load-path "/usr/share/emacs22/site-lisp/slime")
(require 'slime)
(setq inferior-lisp-program "/usr/bin/sbcl")
(slime-setup)

5. 启动slime

M-x slime RET

快捷键

REPL 中的快捷键

RET
输入当前命令(slime-repl-return)
C-RET
关闭所有空行(slime-repl-closing-return)
C-j
换行并缩进,如果有未关闭的括号时候,和RET效果同, 否则重新开启一个空行,但不送出上一行的命令 (slime-repl-newline-and-indent)
C-a
回到行首指示符后面(slime-repl-bol)
C-c C-c
发送SIGINT信号给Lisp进程(slime-interrupt)
C-c M-o
清除buffer内容,只留下一个命令提示符 (slime-repl-clear-buffer)
C-c C-o
清除折叠上个表达式的输出

(slime-repl-clear-output)

`C-<up>, M-x slime-repl-forward-input' `C-<down>, M-x slime-repl-backward-input'

Go to the next/previous history item.

`M-n, M-x slime-repl-next-input' `M-p, M-x slime-repl-previous-input'

Search the next/previous item in the command history using the current input as search pattern. If `M-n'/`M-n' is typed two times in a row, the second invocation uses the same search pattern (even if the current input has changed).

`M-s, M-x slime-repl-next-matching-input' `M-r, M-x slime-repl-previous-matching-input'

Search forward/reverse through command history with regex

`C-c C-n, M-x slime-repl-next-prompt' `C-c C-p, M-x slime-repl-previous-prompt'

Move between the current and previous prompts in the REPL buffer. Pressing RET on a line with old input copies that line to the newest prompt.

slime-mode中的快捷键

Wiki comments powered by Disqus