Mercurial > emacs
comparison lisp/term/pc-win.el @ 19290:7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
(msdos-color-translate): Handle color names which end with a
number, like gray85 and purple3.
(msdos-face-setup): Call `face-set-after-frame-default', so
default faces are correctly set.
Do not set background of the region face (it is set by
`face-set-after-frame-default').
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 11 Aug 1997 01:18:29 +0000 |
parents | e83ac35f9bcb |
children | fa099f73f994 |
comparison
equal
deleted
inserted
replaced
19289:4e824f1fe62d | 19290:7fb99affa49a |
---|---|
129 ("light grey" . "lightgray") | 129 ("light grey" . "lightgray") |
130 ("lightgrey" . "lightgray") | 130 ("lightgrey" . "lightgray") |
131 ("light gray" . "lightgray") | 131 ("light gray" . "lightgray") |
132 ("gray" . "darkgray") | 132 ("gray" . "darkgray") |
133 ("grey" . "darkgray") | 133 ("grey" . "darkgray") |
134 ("gray80" . "darkgray") | |
135 ("gray50" . "black") | |
136 ("gray90" . "darkgray") | |
137 ("khaki" . "green") | 134 ("khaki" . "green") |
138 ("maroon" . "red") | 135 ("maroon" . "red") |
139 ("orange" . "brown") | 136 ("orange" . "brown") |
140 ("orchid" . "brown") | 137 ("orchid" . "brown") |
141 ("saddle brown" . "red") | 138 ("saddle brown" . "red") |
163 ("wheat" . "white") | 160 ("wheat" . "white") |
164 ("green yellow" . "yellow") | 161 ("green yellow" . "yellow") |
165 ("greenyellow" . "yellow") | 162 ("greenyellow" . "yellow") |
166 ("purple" . "magenta") | 163 ("purple" . "magenta") |
167 ("royalblue" . "blue") | 164 ("royalblue" . "blue") |
168 ("grey40" . "darkgray") | |
169 ("rosybrown" . "brown") | 165 ("rosybrown" . "brown") |
170 ("rosy brown" . "brown") | 166 ("rosy brown" . "brown") |
171 ("beige" . "brown")) | 167 ("beige" . "brown")) |
172 "List of alternate names for colors.") | 168 "List of alternate names for colors.") |
173 | 169 |
198 (and (> len 4) | 194 (and (> len 4) |
199 (string= "dark" (substring name 0 4)) | 195 (string= "dark" (substring name 0 4)) |
200 (msdos-color-translate (substring name 4))) | 196 (msdos-color-translate (substring name 4))) |
201 (and (> len 5) | 197 (and (> len 5) |
202 (string= "dark " (substring name 0 5)) | 198 (string= "dark " (substring name 0 5)) |
203 (msdos-color-translate (substring name 5)))))) | 199 (msdos-color-translate (substring name 5))) |
200 (and (> len 4) ;; gray shades: gray0 to gray100 | |
201 (save-match-data | |
202 (and | |
203 (string-match "gr[ae]y[0-9]" name) | |
204 (string-match "[0-9]+\\'" name) | |
205 (let ((num (string-to-int | |
206 (substring name (match-beginning 0))))) | |
207 (msdos-color-translate | |
208 (cond | |
209 ((> num 90) "white") | |
210 ((> num 50) "lightgray") | |
211 ((> num 10) "darkgray") | |
212 (t "black"))))))) | |
213 (and (> len 1) ;; purple1 to purple4 and the like | |
214 (save-match-data | |
215 (and | |
216 (string-match "[1-4]\\'" name) | |
217 (msdos-color-translate | |
218 (substring name 0 (match-beginning 0))))))))) | |
204 ;; --------------------------------------------------------------------------- | 219 ;; --------------------------------------------------------------------------- |
205 ;; We want to delay setting frame parameters until the faces are setup | 220 ;; We want to delay setting frame parameters until the faces are setup |
206 (defvar default-frame-alist nil) | 221 (defvar default-frame-alist nil) |
207 (modify-frame-parameters terminal-frame default-frame-alist) | 222 (modify-frame-parameters terminal-frame default-frame-alist) |
208 | 223 |
215 'light))) | 230 'light))) |
216 | 231 |
217 (defun msdos-face-setup () | 232 (defun msdos-face-setup () |
218 (modify-frame-parameters terminal-frame default-frame-alist) | 233 (modify-frame-parameters terminal-frame default-frame-alist) |
219 | 234 |
235 (modify-frame-parameters terminal-frame | |
236 (list (cons 'background-mode | |
237 (msdos-bg-mode terminal-frame)) | |
238 (cons 'display-type 'color))) | |
239 (face-set-after-frame-default terminal-frame) | |
240 | |
220 (set-face-foreground 'bold "yellow" terminal-frame) | 241 (set-face-foreground 'bold "yellow" terminal-frame) |
221 (set-face-foreground 'italic "red" terminal-frame) | 242 (set-face-foreground 'italic "red" terminal-frame) |
222 (set-face-foreground 'bold-italic "lightred" terminal-frame) | 243 (set-face-foreground 'bold-italic "lightred" terminal-frame) |
223 (set-face-foreground 'underline "white" terminal-frame) | 244 (set-face-foreground 'underline "white" terminal-frame) |
224 (set-face-background 'region "green" terminal-frame) | |
225 | 245 |
226 (make-face 'msdos-menu-active-face) | 246 (make-face 'msdos-menu-active-face) |
227 (make-face 'msdos-menu-passive-face) | 247 (make-face 'msdos-menu-passive-face) |
228 (make-face 'msdos-menu-select-face) | 248 (make-face 'msdos-menu-select-face) |
229 (set-face-foreground 'msdos-menu-active-face "white" terminal-frame) | 249 (set-face-foreground 'msdos-menu-active-face "white" terminal-frame) |
230 (set-face-foreground 'msdos-menu-passive-face "lightgray" terminal-frame) | 250 (set-face-foreground 'msdos-menu-passive-face "lightgray" terminal-frame) |
231 (set-face-background 'msdos-menu-active-face "blue" terminal-frame) | 251 (set-face-background 'msdos-menu-active-face "blue" terminal-frame) |
232 (set-face-background 'msdos-menu-passive-face "blue" terminal-frame) | 252 (set-face-background 'msdos-menu-passive-face "blue" terminal-frame) |
233 (set-face-background 'msdos-menu-select-face "red" terminal-frame) | 253 (set-face-background 'msdos-menu-select-face "red" terminal-frame)) |
234 (modify-frame-parameters terminal-frame | |
235 (list (cons 'background-mode | |
236 (msdos-bg-mode terminal-frame)) | |
237 (cons 'display-type 'color)))) | |
238 | 254 |
239 ;; We have only one font, so... | 255 ;; We have only one font, so... |
240 (add-hook 'before-init-hook 'msdos-face-setup) | 256 (add-hook 'before-init-hook 'msdos-face-setup) |
241 | 257 |
242 ;; We create frames as if we were a terminal, but with a twist. | 258 ;; We create frames as if we were a terminal, but with a twist. |