From: W. Trevor King Date: Tue, 6 Dec 2011 05:30:10 +0000 (-0500) Subject: Add wtk_ansi-color.el to .emacs (*.col support). X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ddaf8463ecb3422ae430cae16e53a5d2472b3f5d;p=dotfiles-public.git Add wtk_ansi-color.el to .emacs (*.col support). --- 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))