1. xemacs
  2. text-modes


text-modes / ansi-color.el

Diff from to

File ansi-color.el

 ;;; ansi-color.el --- translate ANSI escape sequences into faces
-;; Copyright (C) 1999, 2000  Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2001  Free Software Foundation, Inc.
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Maintainer: Alex Schroeder <alex@gnu.org>
-;; Version: 3.4.0
-;; Keywords: comm processes
+;; Version: 3.4.3
+;; Keywords: comm processes terminals services
 ;; This file is part of GNU Emacs.
 ;; Stefan Monnier <foo@acm.com> explaing obscure font-lock stuff and
 ;; code suggestions.
 ;;; Code:
 ;; Customization
 Rendition) control sequences are defined in section 3.8.117 of the
 ECMA-48 standard \(identical to ISO/IEC 6429), which is freely available
 as a PDF file <URL:http://www.ecma.ch/ecma1/STAND/ECMA-048.HTM>."
-  :version "20.7"
+  :version "21.1"
   :group 'processes)
 (defcustom ansi-color-faces-vector
 (defconst ansi-color-parameter-regexp "\\([0-9]*\\)[m;]"
   "Regexp that matches SGR control sequence parameters.")
 ;; Convenience functions for comint modes (eg. shell-mode)
 (defcustom ansi-color-for-comint-mode nil
   "Determines what to do with comint output.
 If nil, do nothing.
-  :version "20.8"
   :type '(choice (const :tag "Do nothing" nil)
 		 (const :tag "Filter" filter)
 		 (const :tag "Translate" t))
   :group 'ansi-colors)
 (defun ansi-color-for-comint-mode-on ()
   "Set `ansi-color-for-comint-mode' to t."
   (setq ansi-color-for-comint-mode 'filter))
 (defun ansi-color-process-output (string)
   "Maybe translate SGR control sequences of comint output into text-properties.
 (add-hook 'comint-output-filter-functions
-;; Alternative font-lock-unfontify-region-function
+;; Alternative font-lock-unfontify-region-function for Emacs only
   ;; We use this to preserve or protect things when modifying text
   (put 'save-buffer-state 'lisp-indent-function 1))
 (defun ansi-color-unfontify-region (beg end &rest xemacs-stuff)
-  "Replacement function for `font-lock-default-unfontify-region'.  
-When font-lock is active in a buffer, you cannot simply add face
-text-properties to the buffer.  Font-lock will remove the face
+  "Replacement function for `font-lock-default-unfontify-region'.
+As text-properties are implemented using extents in XEmacs, this
+function is probably not needed.  In Emacs, however, things are a bit
+different: When font-lock is active in a buffer, you cannot simply add
+face text-properties to the buffer.  Font-lock will remove the face
 text-property using `font-lock-unfontify-region-function'.  If you want
 to insert the strings returned by `ansi-color-apply' into such buffers,
 you must set `font-lock-unfontify-region-function' to
 	  ((eq (car new-faces) 'default)
 	   (cdr new-faces))
-	   (append new-faces face)))))
+	   (append new-faces faces)))))
 (defun ansi-color-make-color-map ()
   "Creates a vector of face definitions and returns it.