Skip to content

Instantly share code, notes, and snippets.

Created March 19, 2010 06:02
  • Star 3 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
coloured SLIME REPL for Clojure
;;; all code in this function lifted from the clojure-mode function
;;; from clojure-mode.el
(defun clojure-font-lock-setup ()
(set (make-local-variable 'lisp-indent-function)
(set (make-local-variable 'lisp-doc-string-elt-property)
(set (make-local-variable 'font-lock-multiline) t)
(add-to-list 'font-lock-extend-region-functions
'clojure-font-lock-extend-region-def t)
(when clojure-mode-font-lock-comment-sexp
(add-to-list 'font-lock-extend-region-functions
'clojure-font-lock-extend-region-comment t)
(make-local-variable 'clojure-font-lock-keywords)
(add-to-list 'clojure-font-lock-keywords
'clojure-font-lock-mark-comment t)
(set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil))
(setq font-lock-defaults
'(clojure-font-lock-keywords ; keywords
nil nil
(("+-*/.<>=!?$%_&~^:@" . "w")) ; syntax alist
(font-lock-mark-block-function . mark-defun)
. lisp-font-lock-syntactic-face-function))))
(add-hook 'slime-repl-mode-hook
(lambda ()
;(font-lock-mode nil)
;(font-lock-mode t)
(defadvice slime-repl-emit (after sr-emit-ad activate)
(with-current-buffer (slime-output-buffer)
(add-text-properties slime-output-start slime-output-end
'(font-lock-face slime-repl-output-face
rear-nonsticky (font-lock-face)))))
(defadvice slime-repl-insert-prompt (after sr-prompt-ad activate)
(with-current-buffer (slime-output-buffer)
(let ((inhibit-read-only t))
(add-text-properties slime-repl-prompt-start-mark (point-max)
'(font-lock-face slime-repl-prompt-face
Copy link

Hi...sorry I get this error message:

error in process filter: Symbol's function definition is void: clojure-font-lock-setup

How can I fix it?...thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment