Source

text-modes / ansi-color.el

Diff from to

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.
 \\[ansi-color-for-comint-mode-on]
 \\[ansi-color-for-comint-mode-off]
 \\[ansi-color-for-comint-mode-filter]"
-  :version "20.8"
   :type '(choice (const :tag "Do nothing" nil)
 		 (const :tag "Filter" filter)
 		 (const :tag "Translate" t))
   :group 'ansi-colors)
 
+;;;###autoload
 (defun ansi-color-for-comint-mode-on ()
   "Set `ansi-color-for-comint-mode' to t."
   (interactive)
   (interactive)
   (setq ansi-color-for-comint-mode 'filter))
 
+;;;###autoload
 (defun ansi-color-process-output (string)
   "Maybe translate SGR control sequences of comint output into text-properties.
 
 (add-hook 'comint-output-filter-functions
 	  'ansi-color-process-output)
 
-;; Alternative font-lock-unfontify-region-function
+
+;; Alternative font-lock-unfontify-region-function for Emacs only
+
 
 (eval-when-compile
   ;; 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))
 	  (t
-	   (append new-faces face)))))
+	   (append new-faces faces)))))
 
 (defun ansi-color-make-color-map ()
   "Creates a vector of face definitions and returns it.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.