I want to view (and/or edit) colorized text in emacs, such as is output by
ls -l --color=always,
tree..., or whatever.
The text I refer to exists in a file. When I open that file in emacs, I want to be able to see it colorized, or toggle it to show ANSI (SGR) escape sequences.
ansi-color.el seems be be what I need, but I haven't been able to get it to do any colorizing of the ANSi escape sequences, but I do see blue-bold for individual contol bytes (eg.
^[)... I'm not sure if that is a feature of
ansi-color, but I think it is.
According to the ansi-color.el comments, it can work with strings and regions, but even that doesn't seem to work.. For example the function
ansi-color-apply-on-region is not recognized by
M-x. It says, "No match"
(require 'ansi-color) to my .emacs file and even
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on). I get no error or warning when emacs starts, so I'm stuck.
How can I get the standard functions to work, and can it be made to automatically apply when opening a file whose name is suffixed with