Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

like image 728
user3691571 Avatar asked Sep 12 '14 13:09

user3691571


1 Answers

this works for me (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))))))
like image 91
inamist Avatar answered Oct 08 '22 05:10

inamist