Emacsist RSS --- If never, make it ever: C-h C-h

ANSI-colors in the compilation buffer output


这里 查看更多 Emacs 相关推荐文章最新 Emacs 圈的动态. 欢迎关注微信公众账号: Emacsist

Countless build tools and shell scripts use ANSI escape codes to colorize their output. This provides impressive improvements to readability when running from a terminal that supports them, but tends to cause a catastrophic mess anywhere else. Emacs’ compilation buffer is one such place. It doesn’t support ANSI colors by default, but that’s very easy to fix.

Emacs already has a library for interpreting ANSI escape. All we need is to hook it onto compilation-mode.

(require 'ansi-color)
(defun endless/colorize-compilation ()
  "Colorize from `compilation-filter-start' to `point'."
  (let ((inhibit-read-only t))
     compilation-filter-start (point))))

(add-hook 'compilation-filter-hook
原文出处: EndlessParenthese
原文地址: http://endlessparentheses.com/ansi-colors-in-the-compilation-buffer-output.html?source=rss
原文时间: 2016-04-26 08:00
本文地址: http://emacsist.com/10864
整理时间: 2016-04-28 02:36

本文由 Hick 整理,转载请保留以上信息;
COPYLEFTThe articles on this site come from Internet, thanks to all the original authors.
      If anything about COPYRIGHT, or LEFT, please contact Emacsist at gmail dot com .