Guest User

Untitled

a guest
May 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. ;;; all code in this function lifted from the clojure-mode function
  2. ;;; from clojure-mode.el
  3. (defun clojure-font-lock-setup ()
  4. (interactive)
  5. (set (make-local-variable 'lisp-indent-function)
  6. 'clojure-indent-function)
  7. (set (make-local-variable 'lisp-doc-string-elt-property)
  8. 'clojure-doc-string-elt)
  9. (set (make-local-variable 'font-lock-multiline) t)
  10.  
  11. (add-to-list 'font-lock-extend-region-functions
  12. 'clojure-font-lock-extend-region-def t)
  13.  
  14. (when clojure-mode-font-lock-comment-sexp
  15. (add-to-list 'font-lock-extend-region-functions
  16. 'clojure-font-lock-extend-region-comment t)
  17. (make-local-variable 'clojure-font-lock-keywords)
  18. (add-to-list 'clojure-font-lock-keywords
  19. 'clojure-font-lock-mark-comment t)
  20. (set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil))
  21.  
  22. (setq font-lock-defaults
  23. '(clojure-font-lock-keywords ; keywords
  24. nil nil
  25. (("+-*/.<>=!?$%_&~^:@" . "w")) ; syntax alist
  26. nil
  27. (font-lock-mark-block-function . mark-defun)
  28. (font-lock-syntactic-face-function
  29. . lisp-font-lock-syntactic-face-function))))
  30.  
  31. (add-hook 'slime-repl-mode-hook
  32. (lambda ()
  33. ;(font-lock-mode nil)
  34. (clojure-font-lock-setup)
  35. ;(font-lock-mode t)
  36. ))
  37.  
  38. (defadvice slime-repl-emit (after sr-emit-ad activate)
  39. (with-current-buffer (slime-output-buffer)
  40. (add-text-properties slime-output-start slime-output-end
  41. '(font-lock-face slime-repl-output-face
  42. rear-nonsticky (font-lock-face)))))
  43.  
  44. (defadvice slime-repl-insert-prompt (after sr-prompt-ad activate)
  45. (with-current-buffer (slime-output-buffer)
  46. (let ((inhibit-read-only t))
  47. (add-text-properties slime-repl-prompt-start-mark (point-max)
  48. '(font-lock-face slime-repl-prompt-face
  49. rear-nonsticky
  50. (slime-repl-prompt
  51. read-only
  52. font-lock-face
  53. intangible))))))
Add Comment
Please, Sign In to add comment