From 0fd40f8951f1aaa387e78999ecfbf6bc954ccf8a Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 19 Feb 2012 21:59:42 +0800 Subject: Use text properties for color escape highlighting in Shell mode. * ansi-color.el: Don't set comint-output-filter-functions; it is now in the initial value defined in comint.el. (ansi-color-apply-face-function): New variable. (ansi-color-apply-on-region): Use it. (ansi-color-apply-overlay-face): New function. * comint.el: Require ansi-color. (comint-output-filter-functions): Add ansi-color-process-output. * shell.el (shell): No need to require ansi-color. (shell-mode): Use ansi-color-apply-face-function to highlight color escapes using font-lock-face property. Fixes: debbugs:10835 --- lisp/comint.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/comint.el') diff --git a/lisp/comint.el b/lisp/comint.el index 975291471df..4c2229f2f83 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -103,6 +103,7 @@ (eval-when-compile (require 'cl)) (require 'ring) +(require 'ansi-color) ;; Buffer Local Variables: ;;============================================================================ @@ -385,7 +386,7 @@ history list. Default is to save anything that isn't all whitespace.") These functions get one argument, a string containing the text to send.") ;;;###autoload -(defvar comint-output-filter-functions '(comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) +(defvar comint-output-filter-functions '(ansi-color-process-output comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) "Functions to call after output is inserted into the buffer. One possible function is `comint-postoutput-scroll-to-bottom'. These functions get one argument, a string containing the text as originally -- cgit v1.2.3