Mercurial > emacs
comparison lisp/term/pc-win.el @ 13924:36aa12b0ea6a
(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.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 02 Jan 1996 23:04:42 +0000 |
parents | 6da84b713ae7 |
children | 187735b53d52 |
comparison
equal
deleted
inserted
replaced
13923:35e379a3952e | 13924:36aa12b0ea6a |
---|---|
34 ("forestgreen" . "green") | 34 ("forestgreen" . "green") |
35 ("darkolivegreen" . "green") | 35 ("darkolivegreen" . "green") |
36 ("darkgoldenrod" . "brown") | 36 ("darkgoldenrod" . "brown") |
37 ("goldenrod" . "yellow") | 37 ("goldenrod" . "yellow") |
38 ("grey40" . "darkgray") | 38 ("grey40" . "darkgray") |
39 ("dark gray" . "darkgray") | |
40 ("light gray" . "lightgray") | |
39 ("rosybrown" . "brown") | 41 ("rosybrown" . "brown") |
40 ("blue" . "lightblue") ;; from here: for Enriched Text | 42 ("blue" . "lightblue") ;; from here: for Enriched Text |
41 ("darkslategray" . "darkgray") | 43 ("darkslategray" . "darkgray") |
42 ("orange" . "brown") | 44 ("orange" . "brown") |
43 ("light blue" . "lightblue") ;; from here: for cpp-highlight | 45 ("light blue" . "lightblue") ;; from here: for cpp-highlight |
52 "List of alternate names for colors.") | 54 "List of alternate names for colors.") |
53 | 55 |
54 (defun msdos-color-translate (name) | 56 (defun msdos-color-translate (name) |
55 (setq name (downcase name)) | 57 (setq name (downcase name)) |
56 (let* ((len (length name)) | 58 (let* ((len (length name)) |
57 (val (cdr (assoc name | 59 (val (- (length x-colors) |
58 '(("black" . 0) | 60 (length (member name x-colors)))) |
59 ("blue" . 1) | |
60 ("green" . 2) | |
61 ("cyan" . 3) | |
62 ("red" . 4) | |
63 ("magenta" . 5) | |
64 ("brown" . 6) | |
65 ("lightgray" . 7) ("light gray" . 7) | |
66 ("darkgray" . 8) ("dark gray" . 8) | |
67 ("lightblue" . 9) | |
68 ("lightgreen" . 10) | |
69 ("lightcyan" . 11) | |
70 ("lightred" . 12) | |
71 ("lightmagenta" . 13) | |
72 ("yellow" . 14) | |
73 ("white" . 15))))) | |
74 (try)) | 61 (try)) |
62 (if (or (< val 0) (>= val (length x-colors))) (setq val nil)) | |
75 (or val | 63 (or val |
76 (and (setq try (cdr (assoc name msdos-color-aliases))) | 64 (and (setq try (cdr (assoc name msdos-color-aliases))) |
77 (msdos-color-translate try)) | 65 (msdos-color-translate try)) |
78 (and (> len 5) | 66 (and (> len 5) |
79 (string= "light" (substring name 0 4)) | 67 (string= "light" (substring name 0 4)) |
141 (fset 'x-get-resource 'ignore) | 129 (fset 'x-get-resource 'ignore) |
142 | 130 |
143 ;; From lisp/term/x-win.el | 131 ;; From lisp/term/x-win.el |
144 (setq x-display-name "pc") | 132 (setq x-display-name "pc") |
145 (setq split-window-keep-point t) | 133 (setq split-window-keep-point t) |
146 | 134 (defvar x-colors '("black" |
135 "blue" | |
136 "green" | |
137 "cyan" | |
138 "red" | |
139 "magenta" | |
140 "brown" | |
141 "lightgray" | |
142 "darkgray" | |
143 "lightblue" | |
144 "lightgreen" | |
145 "lightcyan" | |
146 "lightred" | |
147 "lightmagenta" | |
148 "yellow" | |
149 "white") | |
150 "The list of colors available on a PC display under MS-DOS.") | |
151 (defun x-defined-colors (&optional frame) | |
152 "Return a list of colors supported for a particular frame. | |
153 The argument FRAME specifies which frame to try. | |
154 The value may be different for frames on different X displays." | |
155 x-colors) | |
156 ; | |
147 ;; From lisp/select.el | 157 ;; From lisp/select.el |
148 (defun x-get-selection (&rest rest) "") | 158 (defun x-get-selection (&rest rest) "") |
149 (fset 'x-set-selection 'ignore) | 159 (fset 'x-set-selection 'ignore) |
150 | 160 |
151 ;; From lisp/faces.el: we only have one font, so always return | 161 ;; From lisp/faces.el: we only have one font, so always return |