Cucumber's ANSI colors messing up emacs compilation buffer

前端 未结 3 705
既然无缘
既然无缘 2020-12-04 15:51

When working in Emacs, I use the compile command (F12 by default) to run programs. When I run Cucumber in Emacs, Cucumber spits out ANSI colors that the Emacs compilation m

3条回答
  •  粉色の甜心
    2020-12-04 16:05

    I improve code so it doesn't pollute M-x grep like commands and more efficient:

    (ignore-errors
      (require 'ansi-color)
      (defun my-colorize-compilation-buffer ()
        (when (eq major-mode 'compilation-mode)
          (ansi-color-apply-on-region compilation-filter-start (point-max))))
      (add-hook 'compilation-filter-hook 'my-colorize-compilation-buffer))
    

提交回复
热议问题