technomancy / swank-clojure

Swank/slime support for clojure
Eclipse Public License 1.0
412 stars 83 forks source link

Readme instructions to get syntax highlighting in REPL need update #88

Closed weissjeffm closed 12 years ago

weissjeffm commented 13 years ago

From the readme,

"Put this in your Emacs configuration to get syntax highlighting in the slime repl:

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

That hook did not work for me. I know little about emacs internals, but I found a suggestion that did work for me:

(add-hook 'slime-repl-mode-hook (lambda () (font-lock-mode nil) (clojure-mode-font-lock-setup) (font-lock-mode t)))

Not sure why it is necessary to turn font-lock-mode off and on like that, but it would not work without it.

purcell commented 13 years ago

I noticed the same thing today in Emacs 24. Toggling font-lock-mode like this, however, turns off colorisation of the prompt, so I'm not sure it's the right solution. Not sure how to fix this properly right now.

devinus commented 12 years ago

+1 Same problem for me. Disabling font-lock-mode and then re-enabling it begins to syntax highlight, but the prompt loses color.

technomancy commented 12 years ago

The namespace in the prompt is not colorized with font-lock, so I suspect there's no way to support both clojure-mode font-lock rules and prompt colorization.

weissjeffm commented 12 years ago

Fix works, much appreciated!

devinus commented 12 years ago

This fix actually isn't working for me yet. :( I still have to disable font-lock-mode and enable it again to get the highlighting. Any other things I could try?