Function: ansi-color-make-color-map

ansi-color-make-color-map is a byte-compiled function defined in ansi-color.el.gz.

This function is obsolete since 28.1; you can remove it.

Signature

(ansi-color-make-color-map)

Documentation

Create a vector of face definitions and return it.

The index into the vector is an ANSI code. See the documentation of ansi-color-map for an example.

The face definitions are based upon the variables ansi-color-faces-vector and ansi-color-names-vector.

This function is obsolete, and no longer needed to use ansi-color.

Source Code

;; Defined in /usr/src/emacs/lisp/ansi-color.el.gz
(defun ansi-color-make-color-map ()
  "Create a vector of face definitions and return it.

The index into the vector is an ANSI code.  See the documentation of
`ansi-color-map' for an example.

The face definitions are based upon the variables
`ansi-color-faces-vector' and `ansi-color-names-vector'.

This function is obsolete, and no longer needed to use ansi-color."
  (let ((map (make-vector 50 nil))
        (index 0))
    ;; miscellaneous attributes
    (mapc
     (lambda (e)
       (aset map index e)
       (setq index (1+ index)) )
     ansi-color-faces-vector)
    ;; foreground attributes
    (setq index 30)
    (mapc
     (lambda (e)
       (aset map index
             (ansi-color-make-face 'foreground
                         (if (consp e) (car e) e)))
       (setq index (1+ index)) )
     ansi-color-names-vector)
    ;; background attributes
    (setq index 40)
    (mapc
     (lambda (e)
       (aset map index
             (ansi-color-make-face 'background
                         (if (consp e) (cdr e) e)))
       (setq index (1+ index)) )
     ansi-color-names-vector)
    map))