How can I get syntax highlighting for common lisp in SLIME's REPL?

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

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.

(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))))))
链接地址: http://www.djcxy.com/p/22808.html

上一篇: ios 8主屏幕web应用程序,将iPad关闭并停止运行javascript

下一篇: 我如何在SLIME的REPL中为常见的lisp获得语法高亮?