Function: tty-modify-color-alist
tty-modify-color-alist is a byte-compiled function defined in
tty-colors.el.gz.
Signature
(tty-modify-color-alist ELT &optional FRAME)
Documentation
Put the association ELT into the alist of terminal colors for FRAME.
ELT should be of the form (NAME INDEX R G B) (see tty-color-alist
for details).
If the association for NAME already exists in the color alist, it is
modified to specify (INDEX R G B) as its cdr. Otherwise, ELT is
appended to the end of the color alist.
If FRAME is unspecified or nil, it defaults to the selected frame.
Value is the modified color alist for FRAME.
Source Code
;; Defined in /usr/src/emacs/lisp/term/tty-colors.el.gz
(defun tty-modify-color-alist (elt &optional frame)
"Put the association ELT into the alist of terminal colors for FRAME.
ELT should be of the form (NAME INDEX R G B) (see `tty-color-alist'
for details).
If the association for NAME already exists in the color alist, it is
modified to specify (INDEX R G B) as its cdr. Otherwise, ELT is
appended to the end of the color alist.
If FRAME is unspecified or nil, it defaults to the selected frame.
Value is the modified color alist for FRAME."
(let* ((entry (assoc (car elt) (tty-color-alist frame))))
(if entry
(setcdr entry (cdr elt))
;; Keep the colors in the order they are registered.
(setq entry
(list (append (list (car elt)
(cadr elt))
(copy-sequence (cddr elt)))))
(setq tty-defined-color-alist (nconc tty-defined-color-alist entry)))
tty-defined-color-alist))