From 1c979bff35bb7603245ffbd8aaf19be097dc2bdd Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Fri, 16 Mar 2007 16:53:06 +0000 Subject: [PATCH] eshell ansi-color hook --- lisp/ChangeLog | 5 +++++ lisp/eshell/esh-mode.el | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fe5b283ab53..36f0d35eb5f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-03-16 Mark A. Hershberger + + * eshell/esh-mode.el (eshell-handle-ansi-color): New function. + Add new option for eshell-output-filter-functions. + 2007-03-11 Juri Linkov * replace.el (match): Use yellow background on light-bg terminals. diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index c185e88d8a8..c6abda631dc 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -1078,6 +1078,15 @@ This function could be in the list `eshell-output-filter-functions'." (custom-add-option 'eshell-output-filter-functions 'eshell-handle-control-codes) +(defun eshell-handle-ansi-color () + "Handle ANSI color codes." + (require 'ansi-color) + (ansi-color-apply-on-region eshell-last-output-start + eshell-last-output-end)) + +(custom-add-option 'eshell-output-filter-functions + 'eshell-handle-ansi-color) + ;;; Code: ;;; arch-tag: ec65bc2b-da14-4547-81d3-a32af3a4dc57 -- 2.39.2