如何在SLIME的REPL中获取常见的lisp的语法高亮? [英] How can I get syntax highlighting for common lisp in SLIME's REPL?

查看:150
本文介绍了如何在SLIME的REPL中获取常见的lisp的语法高亮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想学习Common Lisp,并通过emacs包管理器安装了emacs(24.3)和粘贴。

I want to learn Common Lisp and have installed emacs (24.3) and slime via the emacs package manager.

在粘液REPL语法高亮不起作用。当我启动Lisp模式(而在粘液REPL中)时,表达式的值不再被打印(当我输入时,称为Hello World,然后按Enter键,我得到一个新行而不是

In the slime REPL syntax highlighting doesn't work. When I start Lisp-Mode (while in the slime REPL) on the other hand, the values of the expressions don't get printed anymore (when I type, say "Hello World" and hit enter I get a new line instead of the value of the expression.

(如果我打开lisp文件语法高亮工作)

(If I open lisp files syntax highlighting works)

推荐答案

这对我有用
http://compgroups.net /comp.emacs/tweaking-slime/95455 ):

(defvar slime-repl-font-lock-keywords lisp-font-lock-keywords-2)
(defun slime-repl-font-lock-setup ()
  (setq font-lock-defaults
        '(slime-repl-font-lock-keywords
         ;; From lisp-mode.el
         nil nil (("+-*/.<>=!?$%_&~^:@" . "w")) nil
         (font-lock-syntactic-face-function
         . lisp-font-lock-syntactic-face-function))))

(add-hook 'slime-repl-mode-hook 'slime-repl-font-lock-setup)

(defadvice slime-repl-insert-prompt (after font-lock-face activate)
  (let ((inhibit-read-only t))
    (add-text-properties
     slime-repl-prompt-start-mark (point)
     '(font-lock-face
      slime-repl-prompt-face
      rear-nonsticky
      (slime-repl-prompt read-only font-lock-face intangible))))))

这篇关于如何在SLIME的REPL中获取常见的lisp的语法高亮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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