;;
;; If you decide you like this, add the following to your .emacs file:
;;
-;; (autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
;; (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;;
;; SGR control sequences are defined in section 3.8.117 of the ECMA-48
start of the region and set the face with which to start. Set
`ansi-color-context-region' to nil if you don't want this."
(let ((face (car ansi-color-context-region))
- (start-marker (or (cadr ansi-color-context-region)
+ (start-marker (or (cadr ansi-color-context-region)
(copy-marker begin)))
(end-marker (copy-marker end))
escape-sequence)
(defun ansi-color-make-face (property color)
"Return a face with PROPERTY set to COLOR.
-PROPERTY can be either symbol `foreground' or symbol `background'.
+PROPERTY can be either symbol `foreground' or symbol `background'.
For Emacs, we just return the cons cell \(PROPERTY . COLOR).
For XEmacs, we create a temporary face and return it."
((eq (car new-faces) 'default)
(cdr new-faces))
(t
- (append new-faces faces)))))
+ ;; Like (append NEW-FACES FACES)
+ ;; but delete duplicates in FACES.
+ (let ((modified-faces (copy-sequence faces)))
+ (dolist (face (nreverse new-faces))
+ (setq modified-faces (delete face modified-faces))
+ (push face modified-faces))
+ modified-faces)))))
(defun ansi-color-make-color-map ()
"Creates a vector of face definitions and returns it.
((eq val 'default)
(setq f (list val)))
(t
- (add-to-list 'f val))))
+ (unless (member val f)
+ (push val f)))))
f))
(provide 'ansi-color)
+;;; arch-tag: 00726118-9432-44fd-b72d-d2af7591c99c
;;; ansi-color.el ends here