fukamachi/prove

reporter & color scheme

guicho271828 opened this issue · 2 comments

slime-repl can handle the ansi-escape-color in the output.
do not confuse "output" with the "result".

  • the former is something output by pprint.
  • the latter is the string which print-object writes with the result of the evaluation. It usually has a red face.

now it'd be available for us to implement the reporter!

;; see slime-repl.el

(require 'ansi-color)

(defun slime-repl-emit (string)
;; insert the string STRING in the output buffer
(with-current-buffer (slime-output-buffer)
(save-excursion
(goto-char slime-output-end)
(slime-save-marker slime-output-start
(slime-propertize-region '(face slime-repl-output-face
rear-nonsticky (face))
(insert-before-markers string)
(when (and (= (point) slime-repl-prompt-start-mark)
(not (bolp)))
(insert-before-markers "\n")
(set-marker slime-output-end (1- (point)))))))
(when slime-repl-popup-on-output
(setq slime-repl-popup-on-output nil)
(display-buffer (current-buffer)))
(ansi-color-apply-on-region slime-output-start slime-output-end) ;; this line is added
(slime-repl-show-maximum-output)))

pic.twitter.com/Pj3O6ayt

Im not thinking about another library for the colorized format output.