;;; ansi-color.el --- translate ANSI escape sequences into faces
;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Alex Schroeder <alex@gnu.org>
;; Maintainer: Alex Schroeder <alex@gnu.org>
:initialize 'custom-initialize-default
:group 'ansi-colors)
-(defconst ansi-color-regexp "\033\\[\\([0-9;]*\\)m"
+(defconst ansi-color-regexp "\033\\[\\([0-9;]*m\\)"
"Regexp that matches SGR control sequences.")
(defconst ansi-color-parameter-regexp "\\([0-9]*\\)[m;]"
(setq ansi-color-for-comint-mode 'filter))
;;;###autoload
-(defun ansi-color-process-output (string)
+(defun ansi-color-process-output (ignored)
"Maybe translate SGR control sequences of comint output into text-properties.
Depending on variable `ansi-color-for-comint-mode' the comint output is
ESCAPE-SEQ is a SGR control sequences such as \\033[34m. The parameter
34 is used by `ansi-color-get-face-1' to return a face definition."
- (let ((ansi-color-r "[0-9][0-9]?")
- (i 0)
+ (let ((i 0)
f val)
- (while (string-match ansi-color-r escape-seq i)
+ (while (string-match ansi-color-parameter-regexp escape-seq i)
(setq i (match-end 0)
val (ansi-color-get-face-1
- (string-to-number (match-string 0 escape-seq) 10)))
+ (string-to-number (match-string 1 escape-seq) 10)))
(cond ((not val))
((eq val 'default)
(setq f (list val)))