From ddaf8463ecb3422ae430cae16e53a5d2472b3f5d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 6 Dec 2011 00:30:10 -0500 Subject: [PATCH] Add wtk_ansi-color.el to .emacs (*.col support). --- src/.emacs | 1 + src/.emacs.d/load/wtk_ansi-color.el | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/.emacs.d/load/wtk_ansi-color.el diff --git a/src/.emacs b/src/.emacs index 9a9c773..739811e 100644 --- a/src/.emacs +++ b/src/.emacs @@ -17,6 +17,7 @@ (load "wtk_epa.el") (load "wtk_org.el") (load "wtk_no-vc.el") +(load "wtk_ansi-color.el") (require 'cython-mode) diff --git a/src/.emacs.d/load/wtk_ansi-color.el b/src/.emacs.d/load/wtk_ansi-color.el new file mode 100644 index 0000000..96ab681 --- /dev/null +++ b/src/.emacs.d/load/wtk_ansi-color.el @@ -0,0 +1,16 @@ +; event_jr +; http://unix.stackexchange.com/questions/19494/how-to-colorize-text-in-emacs + +(defun ansi-color-apply-on-region-int (beg end) + "apply ANSI colors to the selected region (interactive version)" + (interactive "r") + (ansi-color-apply-on-region beg end)) + +(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))) + +; associate fundamental-ansi-mode with *.col files +(setq auto-mode-alist + (cons '("\\.col\\'" . fundamental-ansi-mode) auto-mode-alist)) -- 2.26.2