Interpret ANSI color esacape sequence by colorifying cotent.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 10 Dec 2015 12:08:31 +0200
changeset 1311 5fd2e01bf582
parent 1310 ca9bfec974ac
child 1312 7c7a0f0e370e
Interpret ANSI color esacape sequence by colorifying cotent.
.emacs-my
--- a/.emacs-my	Wed Dec 02 23:41:53 2015 +0200
+++ b/.emacs-my	Thu Dec 10 12:08:31 2015 +0200
@@ -489,6 +489,14 @@
 
 (ansi-color-for-comint-mode-on)
 
+(defun my-ansi-color (&optional beg end)
+  "Interpret ANSI color esacape sequence by colorifying cotent."
+  (interactive
+   (if (use-region-p)
+       (list (region-beginning) (region-end))
+     (list (point-min) (point-max))))
+  (ansi-color-apply-on-region beg end))
+
 (setq explicit-bash-args '("-i"))
 (setq explicit-sh-args '("-i"))