Cucumber的ANSI颜色混乱emacs编译缓冲区 [英] Cucumber's ANSI colors messing up emacs compilation buffer

查看:259
本文介绍了Cucumber的ANSI颜色混乱emacs编译缓冲区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在Emacs中工作时,我使用编译命令(默认为F12)来运行程序。当我在Emacs中运行Cucumber时,Cucumber会输出Emacs编译模式不能解释的ANSI颜色。结果是丑陋和难以阅读。这里是一个* compilation *缓冲区的代码片段,显示了丑陋的:

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 mode doesn't interpret. The result is ugly and hard to read. Here's a snippet of the *compilation* buffer showing the ugly:

^[[31m(::) failed steps (::)^[[0m

我使用的命令:

( cd ~/lab/rails/todolist && rake cucumber:all )

版本:


  • Emacs 23.1

  • 0.8.3

  • Cucumber-rails 0.3.2

世界将是阳光和鸟如果可以:

The world would be sunshine and birds singing if I could:


  • 获取Emacs在其编译缓冲区中解释ANSI颜色代码,或

  • 获取黄瓜以停止喷发ANSI颜色代码

任何想法?

推荐答案

我使用它来打开我的编译缓冲区中的ansi颜色解释:

I use this to turn on ansi color interpretation in my compilation buffer:

(require 'ansi-color)
(defun colorize-compilation-buffer ()
  (let ((inhibit-read-only t))
    (ansi-color-apply-on-region (point-min) (point-max))))
(add-hook 'compilation-filter-hook 'colorize-compilation-buffer)

这篇关于Cucumber的ANSI颜色混乱emacs编译缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆