From: Richard M. Stallman Date: Tue, 2 Jan 1996 23:04:42 +0000 (+0000) Subject: (x-colors): New variable, a list of colors X-Git-Tag: emacs-19.34~1936 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bb3a4574664d9dd50cd701cc9c0a6acdce7c9c5d;p=emacs.git (x-colors): New variable, a list of colors supported by PC color displays under MS-DOS. (msdos-color-translate): Use `x-colors'. (x-defined-colors): New alternate definition. --- diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el index 95b8cfc0c31..c11634c15a5 100644 --- a/lisp/term/pc-win.el +++ b/lisp/term/pc-win.el @@ -36,6 +36,8 @@ ("darkgoldenrod" . "brown") ("goldenrod" . "yellow") ("grey40" . "darkgray") + ("dark gray" . "darkgray") + ("light gray" . "lightgray") ("rosybrown" . "brown") ("blue" . "lightblue") ;; from here: for Enriched Text ("darkslategray" . "darkgray") @@ -54,24 +56,10 @@ (defun msdos-color-translate (name) (setq name (downcase name)) (let* ((len (length name)) - (val (cdr (assoc name - '(("black" . 0) - ("blue" . 1) - ("green" . 2) - ("cyan" . 3) - ("red" . 4) - ("magenta" . 5) - ("brown" . 6) - ("lightgray" . 7) ("light gray" . 7) - ("darkgray" . 8) ("dark gray" . 8) - ("lightblue" . 9) - ("lightgreen" . 10) - ("lightcyan" . 11) - ("lightred" . 12) - ("lightmagenta" . 13) - ("yellow" . 14) - ("white" . 15))))) + (val (- (length x-colors) + (length (member name x-colors)))) (try)) + (if (or (< val 0) (>= val (length x-colors))) (setq val nil)) (or val (and (setq try (cdr (assoc name msdos-color-aliases))) (msdos-color-translate try)) @@ -143,7 +131,29 @@ ;; From lisp/term/x-win.el (setq x-display-name "pc") (setq split-window-keep-point t) - +(defvar x-colors '("black" + "blue" + "green" + "cyan" + "red" + "magenta" + "brown" + "lightgray" + "darkgray" + "lightblue" + "lightgreen" + "lightcyan" + "lightred" + "lightmagenta" + "yellow" + "white") + "The list of colors available on a PC display under MS-DOS.") +(defun x-defined-colors (&optional frame) + "Return a list of colors supported for a particular frame. +The argument FRAME specifies which frame to try. +The value may be different for frames on different X displays." + x-colors) +; ;; From lisp/select.el (defun x-get-selection (&rest rest) "") (fset 'x-set-selection 'ignore)