我有一个包含 VT-100 转义序列(颜色、粗体等)的文件(程序输出)。当我在 Fundamental 模式下打开文件时,转义序列按原样显示,并且不被解释。如何显示识别为颜色等的 VT-100 序列文件?
最佳答案
参见 https://unix.stackexchange.com/questions/19494/how-to-colorize-text-in-emacs
例如:将以下内容放入您的 emacs 初始化文件中:
(define-derived-mode fundamental-ansi-mode fundamental-mode "fundamental ansi"
"Fundamental mode that understands ansi colors."
(require 'ansi-color)
(ansi-color-apply-on-region (point-min) (point-max)))
然后使用转义序列在缓冲区上运行 M-x fundamental-ansi-mode
。
https://stackoverflow.com/questions/17468696/